If there is no CAN bus then each attempt to transmit a frame will fail and the transmit error counter will increase. The error counter can be read before and after transmission. In addition CAN controllers typically provide a range of error flags in a register which gives a reason for the transmission failure which can usually be connected to an error interrupt. Note that in this situation the error counter will stop before reading 256 and therefore the bus off state will not be entered.
"FAQ contribution from Embedded Systems Academy, experts in CAN bus. For more information visit www.esacademy.com"