Skip to content

Instantly share code, notes, and snippets.

@es-kumagai
Created May 24, 2017 11:04
Show Gist options
  • Save es-kumagai/2cce983b4ca2fd4cc4b1b3c912f21a8b to your computer and use it in GitHub Desktop.
Save es-kumagai/2cce983b4ca2fd4cc4b1b3c912f21a8b to your computer and use it in GitHub Desktop.
ちなみに catch {} で暗黙宣言される error 変数の名前を変えたい時はこんな感じ。 #read_swift #CodePiece
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