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

Print stack trace on uncaught exception. #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wconrad
Copy link
Contributor

@wconrad wconrad commented Jun 21, 2014

This patch causes uncaught exceptions in rtlr to print a stack track to aid in debugging. The meaning of the existing exit codes is preserved.

The code could be made simpler if Runner does not catch Exception, but that would mean rearranging the exit codes, since exit code 1 (which Ruby emits on an uncaught exception) is already used for ERRNO_USAGE. Rearranging the exit codes would be a breaking API change.

Simpler still would be to eliminate the separate error codes, and use use exit code 1 for everything. All of the exception handling in Runner could then be done in one rescue. This would be a more-breaking API change.

This allows the diagnosis of errors in rtlr itself.
@jarhart
Copy link
Owner

jarhart commented Jul 29, 2014

I would say go ahead and change the error codes to make more sense. At this stage I'm more interested in getting it right than avoiding breaking changes, especially for something as peripheral as the shell exit codes.

@wconrad
Copy link
Contributor Author

wconrad commented Jul 29, 2014

The middle option, then, where the separate error codes are maintained, but rearranged?

@jarhart
Copy link
Owner

jarhart commented Jul 29, 2014

I think that's best, yeah.

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.

2 participants