Errors now always throw and thus exit with non-zero exit code #348
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.
Fixes the second part of #346 (\cc @NachoSoto)
Basically, I've removed all
logMessage(.error, …)
calls and replaced intermediatedo { } catch { }
blocks withErrorPrettifier.execute { }
, which rethrows the error (and let it bubble up all the way toCommander.main
) — just prettifying non-SwifGen, genericNSCocoaErrors
thrown in that closure before rethrowing them, so that "Permission denied" errors and such are not printed in an ugly message instderr
but are presented in a nicer way.@djbe this PR is meant to be merged after #347 so I've made the request to merge into your fix/templateref-empty-path branch. We can either merge #347 first then this one next, or merge this one first into #347 then merge #347 to merge it all to master.