Fix #4039. Experiment with more terse renderException() and Collision #4649
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here is a frankenPR which accumulates two experiments in better exception and error presentation. Lets discuss and implement the pieces that make sense.
Implement \Drush\Application::renderException so that Console does not print the command help at end of each exception (e.g.
sql:query [--result-file ...). This is a minimal change, and fixes the part of Make error output less verbose #4039 that I agree with.Instructs Symfony Console runner not to handle Exceptions. Now that we are responsible for presenting errors and exceptions, we use Collision. See screenshots below. This error handler is the default in Laravel. Its presentation is verbose but I think it shows helpful info. The main components
Error/Exception message.
A code excerpt with failing line and surrounding lines.
Stack trace. 2 frames are shown by default, or all frames when in Verbose mode. Arguments are also shown, noting their types.
Some risks of Collision approach
Below is with Verbose. Note additional stack frames in the trace.