For Catholics, in the eastern canon law (CCEO), we have this canon:
Canon 598 – § 1. Those things are to be believed by divine and catholic faith which are contained in the word of God as it has been written or handed down by tradition, that is, in the single deposit of faith entrusted to the Church, and which are at the same time proposed as divinely revealed either by the solemn Magisterium of the Church, or by its ordinary and universal Magisterium, which in fact is manifested by the common adherence of Christ’s faithful under the guidance of the sacred Magisterium. All Christian faithful are therefore bound to avoid any contrary doctrines.
§ 2. Furthermore, each and everything set forth definitively by the Magisterium of the Church regarding teaching on faith and morals must be firmly accepted and held; namely, those things required for the holy keeping and faithful exposition of the deposit of faith; therefore, anyone who rejects propositions which are to be held definitively sets himself against the teaching of the Catholic Church.
Canon 1436 – § 1. Whoever denies a truth which must be believed with divine and catholic faith, or who calls into doubt, or who totally repudiates the Christian faith, and does not retract after having been legitimately warned, is to be punished as a heretic or an apostate with a major excommunication; a cleric moreover can be punished with other penalties, not excluding deposition.
§ 2. In addition to these cases, whoever obstinately rejects a teaching that the Roman Pontiff or the College of Bishops, exercising the authentic Magisterium, have set forth to be held definitively, or who affirms what they have condemned as erroneous, and does not retract after having been legitimately warned, is to be punished with an appropriate penalty.