From 2bafc5271261872db572e561ae3a4c27571bb09a Mon Sep 17 00:00:00 2001 From: Sergey Udalov <45697468+2jumper3@users.noreply.github.com> Date: Tue, 9 Jan 2024 14:28:27 +0100 Subject: [PATCH] Update WalletPairService.swift Since the method is marked as throws, when called within a do block, nothing happens if the session is already inactive, consequently making it impossible to handle. --- .../Services/Wallet/WalletPairService.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/WalletConnectPairing/Services/Wallet/WalletPairService.swift b/Sources/WalletConnectPairing/Services/Wallet/WalletPairService.swift index 7c04a0acc..e9dea0198 100644 --- a/Sources/WalletConnectPairing/Services/Wallet/WalletPairService.swift +++ b/Sources/WalletConnectPairing/Services/Wallet/WalletPairService.swift @@ -4,6 +4,7 @@ actor WalletPairService { enum Errors: Error { case pairingAlreadyExist(topic: String) case networkNotConnected + case noPendingRequest } let networkingInteractor: NetworkInteracting @@ -30,7 +31,7 @@ actor WalletPairService { logger.debug("Pairing with uri: \(uri)") guard try !pairingHasPendingRequest(for: uri.topic) else { logger.debug("Pairing with topic (\(uri.topic)) has pending request") - return + throw Errors.noPendingRequest } let pairing = WCPairing(uri: uri)