Skip to content

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.

3 participants