Skip to content

Instantly share code, notes, and snippets.

@bsneed
Created November 4, 2016 18:07
Show Gist options
  • Save bsneed/2ecf3b3fc68bdee6c88a5e34820300e5 to your computer and use it in GitHub Desktop.
Save bsneed/2ecf3b3fc68bdee6c88a5e34820300e5 to your computer and use it in GitHub Desktop.
Exception failure in swift.
public func exceptionFailure(_ message: String) {
let args: [CVarArg] = []
if isInUnitTest() {
NSException.raise(NSExceptionName(rawValue: ELExceptionFailure), format: message, arguments: getVaList(args))
} else {
#if DEBUG
NSException.raise(NSExceptionName(rawValue: ELExceptionFailure), format: message, arguments: getVaList(args))
#endif
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment