How to redirect to custom error page?

Hi all,
I want if any type of error from prosody or jitsi meet occurs then a custom page should be displayed. Anyone can help me related to this scenario.
Thanks.