Skip to content

Commit 2b31aea

Browse files
committed
chore: add error alias
1 parent 0f24268 commit 2b31aea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ios/Components/NativeModuleError.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ enum NativeModuleError: LocalizedError, KnownError {
8686
if error.isComponentCanceled || error.is3DSCanceled {
8787
return NativeModuleError.canceled
8888
}
89-
if error is HTTPResponse<EmptyErrorResponse> {
89+
if error.isEmpty401NetworkingResponseError {
9090
return NativeModuleError.invalidClientKey
9191
}
9292
return error
@@ -101,4 +101,8 @@ extension Error {
101101
(self as NSError).domain == "com.adyen.Adyen3DS2.ADYRuntimeError" &&
102102
(self as NSError).code == ADYRuntimeErrorCode.challengeCancelled.rawValue
103103
}
104+
105+
var isEmpty401NetworkingResponseError: Bool {
106+
self is HTTPResponse<EmptyErrorResponse>
107+
}
104108
}

0 commit comments

Comments
 (0)