Render error page before handling

The current error page will be a blank white page if something goes wrong with error processing. This way, the error page is rendered before any processing so the user always gets a message page.