Skip to content

Better handle errors where conversion occurs. #11

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

Merged
merged 1 commit into from
May 18, 2021
Merged

Conversation

bsneed
Copy link
Contributor

@bsneed bsneed commented May 18, 2021

  • Adds exceptionFailure method.
  • Better reports errors to developers where conversions or critical errors might occur.

@bsneed bsneed merged commit 8bdf2b3 into main May 18, 2021
@bsneed bsneed deleted the bsneed/stop_trying_lol branch May 18, 2021 20:36
internal func exceptionFailure(_ message: String) {
let args: [CVarArg] = []
if isUnitTesting {
NSException.raise(NSExceptionName(_SegmentException), format: message, arguments: getVaList(args))
Copy link
Contributor

@migs647 migs647 May 18, 2021

Choose a reason for hiding this comment

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

Are we sure we want to use NSExceptions? They aren't friendly with recovery, and apple doesn't recommend usage unless you fail / exit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's why I used them. I want a hard stop when unit testing or during development.

Copy link
Contributor

@migs647 migs647 May 18, 2021

Choose a reason for hiding this comment

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

Awesome, if that is the intention then we're good :)

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