Errors now always throw and thus exit with non-zero exit code#348
Merged
djbe merged 2 commits intofix/templateref-empty-pathfrom Oct 24, 2017
Merged
Errors now always throw and thus exit with non-zero exit code#348djbe merged 2 commits intofix/templateref-empty-pathfrom
djbe merged 2 commits intofix/templateref-empty-pathfrom
Conversation
added 2 commits
October 24, 2017 12:40
Note: NSCocoaErrors like "Permission denied" or "Directory not found" and such are wrapped in a prettier format whenever possible.
djbe
approved these changes
Oct 24, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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, genericNSCocoaErrorsthrown in that closure before rethrowing them, so that "Permission denied" errors and such are not printed in an ugly message instderrbut 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.