Skip to content

Errors now always throw and thus exit with non-zero exit code#348

Merged
djbe merged 2 commits intofix/templateref-empty-pathfrom
fix/exit-non-zero
Oct 24, 2017
Merged

Errors now always throw and thus exit with non-zero exit code#348
djbe merged 2 commits intofix/templateref-empty-pathfrom
fix/exit-non-zero

Conversation

@AliSoftware
Copy link
Copy Markdown
Collaborator

@AliSoftware AliSoftware commented Oct 24, 2017

Fixes the second part of #346 (\cc @NachoSoto)

Basically, I've removed all logMessage(.error, …) calls and replaced intermediate do { } catch { } blocks with ErrorPrettifier.execute { }, which rethrows the error (and let it bubble up all the way to Commander.main) — just prettifying non-SwifGen, generic NSCocoaErrors thrown in that closure before rethrowing them, so that "Permission denied" errors and such are not printed in an ugly message in stderr 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.

Olivier Halligon 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.
@AliSoftware AliSoftware requested a review from djbe October 24, 2017 10:47
@djbe djbe merged commit 8e55021 into fix/templateref-empty-path Oct 24, 2017
@djbe djbe deleted the fix/exit-non-zero branch October 24, 2017 10:59
Copy link
Copy Markdown

@NachoSoto NachoSoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

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.

3 participants