Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Some Error can be catch but not thrown
import StoreKit
//extension SKError: Error { } // Uncomment this line to make it throwable
func throwError() throws {
throw SKError.unknown // Can not be thrown. Thrown error code type 'SKError.Code' does not conform to 'Error'
do {
try throwError()
} catch {
switch error {
case SKError.unknown: // Can be catch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.