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

Set catchExceptions to false by default #68

Closed
wants to merge 2 commits into from

Conversation

Rixafy
Copy link

@Rixafy Rixafy commented Apr 26, 2022

Default value for catchExceptions is inherited from symfony/console (true), it means that exception will be always caught by symfony/console and displayed as a red text in console and it won't be thrown again, so Tracy can't catch it and it won't be logged anywhere.

@JanTvrdik
Copy link
Contributor

Are you should this will not break command exit code?

@Rixafy
Copy link
Author

Rixafy commented Apr 26, 2022

It will change the exit code from 1 to 255, only if that config parameter wasn't specified, but that would mean that any exception could not be logged, now it will be logged and exit code will be 255.

@Rixafy
Copy link
Author

Rixafy commented Apr 29, 2022

What if the default value wasn't false, but %debugMode%? Because I guess most people will have set it up this way anyway, since it causes no problems at all, when you are in debugMode, you can see the exceptions in the console, so for instance when you try migrations:diff and there is no changes, there will be an error message from doctrine in debugMode, but in production there will be only Tracy message that error has occured and it will be logged, possibly sent with monolog.

When we have false as a default value, then errors from production will be logged to tracy as they should, but on the other hand, when such silly error occurs in migrations diff command that there are no schema changes, it will not show itself to user, and therefore he must search for a log to find it, what is not very expected behavior.

It would be achievable via Expect::bool(!Debugger::$productionMode), since $productionMode is reversed $debugMode that goes into nette configurator.

@f3l1x
Copy link
Member

f3l1x commented Jan 3, 2024

I would stay with symfony default value.

@f3l1x f3l1x closed this Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants