How to redirect to an error page on error?

This feels like it should be a simple thing but I’m unable to find an answer.

I have a simple Sentry\init(['dsn' => '...']) in my php app that works as expected and handles all errors and exceptions.

The problem is that when an error occurs the website shows a blank screen.

Instead, I’d like it to show a simple error page that notifies users that an error has occurred (and that the blank screen is not expected).

What would be the simplest way to do it?