error handling and fault confinement is done automatically and follows CAN Protocol standard;https://www.nxp.com/docs/en/reference-manual/BCANPSV2.pdf
Once error is detected, respective flag in ESR1 register is set and error counters are updated as per protocol standard.
- you can put FlexCAN to Freeze mode, this way it does not participate on bus
- you can put transceiver to Standby mode by driving STB pin high. But if FlexCAN is transmitting anything it will ends in Bus off state.