Returning NSError with error code Success makes trouble sometimes.
The following code snippet opens a wallet using async/await in swift5. It always throws error and does not return wallet handle because the error included in the completion handler is not nil.
let wallet = IndyWallet.sharedInstance()!
var walletHandle : IndyHandle?
do {
walletHandle = try await wallet.open(withConfig: walletConfig, credentials: walletCredentials)
} catch {
if let err = error as NSError? {
print("Cannot open wallet: \(err.userInfo["message"] ?? "Unknown error")")
}
return
}
So, NSError should be nil when the indy_error_code is Success.
Signed-off-by: conanoc conanoc@gmail.com
Returning NSError with error code Success makes trouble sometimes. The following code snippet opens a wallet using async/await in swift5. It always throws error and does not return wallet handle because the error included in the completion handler is not nil.
So, NSError should be nil when the indy_error_code is Success.