-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Proposal] create a view for whoops errors instead of the currently hard coded #14137
Comments
this doesn't fix the issue because most of the errors are handled through that view, so to override it you will have to write the error exception one by one, this error basically handle anything other than the 404., check the original method to get a better idea. if am wrong plz correct me 👍 |
You can write a different error page for each status code. I thought that was what you wanted. Otherwise you can just write your own exception handler and decide whether or not to pass it to the base class or handle it yourself, see (https://laravel.com/docs/5.2/errors#the-exception-handler) |
what i wanted is to have a default error view that i can modify anyway it fits the app, and if i still need to make something in specific for one type of the errors then am still free to do so, but having that god forsaken whoops page popping up in each app gets created with the framework is simply non-sense 😞 . |
How about overwriting the decorate method in the app/exceptions/handler.php? |
i believe it wont make a difference because of the original method
which have the whoops msg. |
/**
* Convert the given exception into a Response instance.
*
* @param \Exception $e
*
* @return \Symfony\Component\HttpFoundation\Response
*/
protected function convertExceptionToResponse(Exception $e)
{
$debug = config('app.debug', false);
if (!! $debug) {
$e = FlattenException::create($e);
$handler = new SymfonyExceptionHandler(config('app.debug'));
$decorated = $this->decorate($handler->getContent($e), $handler->getStylesheet($e));
return SymfonyResponse::create($decorated, $e->getStatusCode(), $e->getHeaders());
}
return response()->view('errors.error', ['exception' => $e], 500);
} |
You can use something like https://github.com/GrahamCampbell/Laravel-Exceptions. |
@GrahamCampbell am already using it in local, but in production am using bug snag which as far as i know doesn't have the same flexibility , or does it ? |
It is very flexible in production too. https://styleci.io/ uses it in production. |
We also use Bugsnag for logging errors. |
In order to use Bugsnag, you don't need to use their laravel package. You can use https://github.com/AltThree/Bugsnag along with https://github.com/AltThree/Logger. |
I'm working on getting their next laravel package to use psr loggers rather than overriding the exception handler actually. |
My exception package is absolutely designed for production use. The fact it has application in development is purely a consequence of the design used. It's transformer and displayer system is very powerful. |
actually the only reason am using bugsnag is to get notified when something happens and trace the error from their dashboard, if ur package offers the same i would be extremely happy to go with it instead 👍 , anyhow can u make a small guide on how to implement the AltThree packages, specially i don't know where i would add the bugsnag key or should i replace the default exception handler with something else or not, etc... |
Well, actually, I am for now. I'm working for Bugsnag for 12 weeks. ;) |
awesome 💯 and for the exception handler, it will be https://github.com/GrahamCampbell/Laravel-Exceptions. right ? |
Yes. :) |
sweet, many thanx gc 🤘 |
No problem. :) |
can you please 🙏 create a view for the whoops page like the included 503 view instead of the currently hard coded in
vendor/symfony/debug/ExceptionHandler.php
so the user can easily edit it without to much trouble ?The text was updated successfully, but these errors were encountered: