Implemented a more robust solution to retrieving the current site's error page.