To activate the error callback you activate the FDCAN interrupt and it will generate a call to the interrupt service routine which will process all the interrupt sources including the errors.
Then you overwrite the callback function with the wanted behavior: