Add support for exiting without printing an error #51
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.
Description
This adds an
ExitCodeerror type that stores an exit code, and updates the exit machinery (1) to useExitCodeas the source for exit codes, and (2) to silently exit when the provided error is anExitCodeinstance.New API:
Documentation Plan
Included API documentation and expanded a section in the Validation & Errors guide.
Test Plan
Added tests for failing silently and for exiting with each preset error code and a custom error code.
Source Impact
The new type is an additive change. There's an additional behavior change that I'd call a bug fix, where errors that convert to an empty string now don't print the
"Error:"prefix by itself.