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

Extract a method to render an exception output #68

Merged
merged 1 commit into from Apr 17, 2019
Merged

Conversation

StijnVrolijk
Copy link

Since we only need this output in certain situations we don't have to render it every time.

A common occurrence was an exception containing an object originating from Doctrine that contains large objects or even circular references. Spoon would then attempt to use var_dump to display these objects causing memory issues.

This commit only attempts to dump variables when necessary, examples being debug mode or callbacks.
Most of the time Symfony's debug bundle will take care of error handling in those situations but when that's not available this still outputs all necessary data. Usually you will have a lot more memory available if you are running in debug mode.

Apologies in advance for the rather chaotic commit but the code styles were driving me crazy.

Since we only need this output in certain situations we don't have to render it every time.

A common occurrence was an exception containing an object originating from Doctrine that contains large objects or even circular references. Spoon would then attempt to use `var_dump` to display these objects causing memory issues.

This commit only attempts to dump variables when necessary, examples being debug mode or callbacks.
Most of the time Symfony's debug bundle will take care of error handling in those situations but when that's not available this still outputs all necessary data. Usually you will have a lot more memory available if you are running in debug mode.
@carakas carakas merged commit d75e25a into master Apr 17, 2019
@carakas carakas deleted the dont-always-output branch June 13, 2019 09:41
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

Successfully merging this pull request may close these issues.

None yet

2 participants