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

Support Exit codes from thrown CustomNSError conformers #244

Merged

Conversation

SergeyPetrachkov
Copy link
Contributor

@SergeyPetrachkov SergeyPetrachkov commented Oct 2, 2020

Introduce support for CustomNSError protocol conformers. Previously executable targets would exit with code 1, but it seems like a good idea to exit with a code provided by the user's custom error type.

I've added a sample executable target, and a few tests to cover things up.

This PR references #243 and #230

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary(no need i guess)

@SergeyPetrachkov
Copy link
Contributor Author

@swift-ci please test

@natecook1000
Copy link
Member

Thanks for this contribution, @SergeyPetrachkov! I think we can test this without adding the separately compiled example — can you add your tests for handling CustomNSError types to ExitCodeTests.swift?

@SergeyPetrachkov
Copy link
Contributor Author

SergeyPetrachkov commented Oct 25, 2020

Thanks for this contribution, @SergeyPetrachkov! I think we can test this without adding the separately compiled example — can you add your tests for handling CustomNSError types to ExitCodeTests.swift?

Yes, sure, I'll do it

@SergeyPetrachkov
Copy link
Contributor Author

@natecook1000 I've updated the PR according to your notes. Take a look when you have time.

@natecook1000
Copy link
Member

@swift-ci Please test

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