Skip to content

Commit

Permalink
SKError still is not a real Error, hard-code these
Browse files Browse the repository at this point in the history
Not ideal, but there’s also no harm in it.
  • Loading branch information
mxcl committed Oct 2, 2018
1 parent 4142285 commit 4ff9962
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/Error.swift
Expand Up @@ -83,7 +83,12 @@ extension Error {
} catch CocoaError.userCancelled {
return true
} catch {
#if os(macOS) || os(iOS) || os(tvOS)
let pair = { ($0.domain, $0.code) }(error as NSError)
return ("SKErrorDomain", 2) == pair
#else
return false
#endif
}
}
}
Expand Down

0 comments on commit 4ff9962

Please sign in to comment.