How to register a callback when an error happens?

I don’t want to change any default Sentry/Raven behavior. I just want to show a little message to the user saying “some went wrong, we will fix etc. etc.” How can I do this?