Skip to content

Commit 22a1133

Browse files
committed
Apply okadan#84
1 parent abffea8 commit 22a1133

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ios/Classes/Translator.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,10 @@ func getErrorMap(_ arg: Error) -> [String : Any?] {
158158
}
159159

160160
func getFlutterError(_ arg: Error) -> FlutterError {
161-
return FlutterError(code: "\((arg as NSError).code)", message:arg.localizedDescription, details: nil)
162-
}
161+
let error = arg as NSError;
162+
if let isoError = error.userInfo[NFCISO15693TagResponseErrorKey] {
163+
return FlutterError(code: "\(isoError)", message:error.localizedDescription, details: nil);
164+
} else {
165+
return FlutterError(code: "\(error.code)", message:error.localizedDescription, details: nil);
166+
}
167+
}

0 commit comments

Comments
 (0)