Created
May 24, 2017 11:04
-
-
Save es-kumagai/2cce983b4ca2fd4cc4b1b3c912f21a8b to your computer and use it in GitHub Desktop.
ちなみに catch {} で暗黙宣言される error 変数の名前を変えたい時はこんな感じ。 #read_swift #CodePiece
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct SomeError : Error { | |
} | |
let error = SomeError() | |
error._code // 1 | |
error._domain // __lldb_expr_16.SomeError | |
do { | |
throw SomeError() | |
} | |
catch let reason { | |
print(reason) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment