Skip to content
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

Unable to render errors if reporting throws an exception #19973

Closed
LavaToaster opened this issue Jul 10, 2017 · 2 comments
Closed

Unable to render errors if reporting throws an exception #19973

LavaToaster opened this issue Jul 10, 2017 · 2 comments

Comments

@LavaToaster
Copy link

  • Laravel Version: Irrelevant
  • PHP Version: Irrelevant
  • Database Driver & Version: Irrelevant

Description:

I had an issue where something was logging to laravel.log but it couldn't write to it, so when the exception handler caught it and attempted to log the exception, by also writing to laravel.log, it errored out without logging anything or showing on screen.

So, if the exception handler report throws an exception, there is no way of reporting the exception

Steps To Reproduce:

Make your log file unwritable: (ug+r, User/Group Add Read permission, ug-w, User/Group Revoke Write permission

touch storage/logs/laravel.log
chmod ug+r,ug-w storage/logs/laravel.log

Throw an exception anywhere in the application.

Possible Fix:

In here at line 80.

// Global catch all so we can still render errors if we're unable to report them.
try {
    $this->getExceptionHandler()->report($e);
} catch (\Exception $e) {}

I can submit this as a PR, or you could make the change yourself. I just want to ensure that this is something you want to pursue first.

@themsaid
Copy link
Member

Thank you, a PR was submitted here: #19977

@LavaToaster
Copy link
Author

🎉 Thanks @themsaid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants