diff --git a/Example/BloctoSDK/Utilities/ErrorHandler.swift b/Example/BloctoSDK/Utilities/ErrorHandler.swift index 9344caa..434da2b 100644 --- a/Example/BloctoSDK/Utilities/ErrorHandler.swift +++ b/Example/BloctoSDK/Utilities/ErrorHandler.swift @@ -45,7 +45,7 @@ enum ErrorHandler { case .userNotMatch: label.text = "user not matched." case .ethSignInvalidHexString: - label.text = "input text should be hex string with 0x prefix." + label.text = "input text invalid, should be hex string with 0x prefix." case .userCancel: label.text = "user canceled." case .redirectURLNotFound: diff --git a/Sources/Core/BloctoSDK.swift b/Sources/Core/BloctoSDK.swift index b5e4ac5..b7c25fc 100644 --- a/Sources/Core/BloctoSDK.swift +++ b/Sources/Core/BloctoSDK.swift @@ -225,16 +225,19 @@ public class BloctoSDK { ) } catch { method.handleError(error: error) - do { - let window = try self.getWindow?() - Task(priority: .high) { - await self.routeToWebSDK(window: window, method: method) + // would not routeToWebSDK when error occured request account + if self.evm.sessionId != nil { + do { + let window = try self.getWindow?() + Task(priority: .high) { + await self.routeToWebSDK(window: window, method: method) + } + } catch { + log( + enable: self.logging, + message: "Window not found." + ) } - } catch { - log( - enable: self.logging, - message: "Window not found." - ) } } }