anlutro / laravel-4-smart-errors

Smarter error handling for Laravel 4
65 stars 13 forks source link

[question] Not sent mail on 403 #19

Closed tomvo closed 9 years ago

tomvo commented 9 years ago

I'm using 403's to show a user an unauthorized page, I push the error handler that shows the nice 403 page on to the handler stack. All works fine but smart errors still sends me an error email. How can I tell smart errors not to send me an email upon a 403?

anlutro commented 9 years ago

If you use pushError(), that will push your handler to the bottom of the stack, which means that the SmartErrors error handler will be invoked before yours. You can either call error() instead of pushError(), or make sure that your pushError() is called before the SmartErrors one - by creating a service provider that is placed before the SmartErrors service provider. You can call pushError() inside a service provider's boot() method.