Below I have some code within my bootstrap.php file that should display a pretty error page whenever a page within the website can't resolve. However, the line echo 'Todo: Friendly error page';
keeps displaying before Bugsnag can get the error information. Any assistance or insight would be appreciated.
/**
* Register the error handler
*/
$whoops = new \Whoops\Run;
if ($is_prod) {
$whoops->pushHandler(function($e){
echo 'Todo: Friendly error page';
});
$bugsnag = Bugsnag\Client::make("61a075bcdc8317eab9ed0ab86aada144");
Bugsnag\Handler::register($bugsnag);
} else {
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
}
$whoops->register();