Exception handler: Capture the record id

Jmix 1.5.5
I have some exception handlers to send to a message service. I want to add the record Id in the exception handler if the exception appears when user interacts with the record. These exceptions are unexpected, and I don’t know which screen it is. Can we do that?