-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add ability to display stacktraces from unhandled exceptions #166
Comments
I've been modifying my
This shows the stack trace. It would be nice to have an option to show this :-) J |
jhorbulyk
added a commit
to elasticio/Caporal.js
that referenced
this issue
Feb 17, 2020
If the -v / --version flag is set and an unhandled error is thrown, the stacktract of that error will be rendered. Fixed some bugs related to some unhandled exceptions not being handled correctly. Fixes mattallty#166
jhorbulyk
added a commit
to elasticio/Caporal.js
that referenced
this issue
Feb 17, 2020
If the -v / --version flag is set and an unhandled error is thrown, the stacktract of that error will be rendered. Fixed some bugs related to some unhandled exceptions not being handled correctly. Add .idea to .gitignore. Fixes mattallty#166
jhorbulyk
added a commit
to elasticio/Caporal.js
that referenced
this issue
Feb 17, 2020
If the -v / --version flag is set and an unhandled error is thrown, the stacktract of that error will be rendered. Fixed some bugs related to some unhandled exceptions not being handled correctly. Add .idea to .gitignore. Fixes mattallty#166
jhorbulyk
added a commit
to elasticio/Caporal.js
that referenced
this issue
Feb 17, 2020
If the -v / --verbose flag is set and an unhandled error is thrown, the stacktract of that error will be rendered. Fixed some bugs related to some unhandled exceptions not being handled correctly. Add .idea to .gitignore. Fixes mattallty#166
mattallty
pushed a commit
that referenced
this issue
May 4, 2020
) If the -v / --verbose flag is set and an unhandled error is thrown, the stacktract of that error will be rendered. Fixed some bugs related to some unhandled exceptions not being handled correctly. Fixes #166
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
When the code inside of a command throws an exception that is not caught caporal prints the message of the exception that is thrown and has the process exit with code 2. When this thrown exception is the result of bad inputs or failures to access resources (e.g. internet, files, etc), this behavior is OK. However, when an exception is thrown because of poor programming logic on the part of the command author, it's very difficult to diagnose what has happened, expectially when the exception is thrown by dependency libraries or node built-ins. It would be nice if there was some way that the stack trace could be rendered to fix those cases.
Describe the solution you'd like
When the verbose flag is set and an unhandled exception is thrown from inside a command, print out the full stack trace of the exception in addition to the exception's message. When the verbose flag is not set, continue to only print out the exception's message.
Describe alternatives you've considered
Adding another flag or environment variable to toggle this behavior is an option, but extending existing flags is probably more desirable.
Additional context
The documentation so far doesn't really lay out best practices for errors and exceptions.
Would you be able to work on it and provide a pull request ?
The text was updated successfully, but these errors were encountered: