From aae2f5fcd1d7141421eed7295ceeb3159948c45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDiga=20Kokelj?= Date: Wed, 1 Nov 2023 11:27:48 +0100 Subject: [PATCH] Return error instead of just logging it if client fails (#1632) --- tools/walletextension/accountmanager/account_manager.go | 3 ++- tools/walletextension/wallet_extension.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/walletextension/accountmanager/account_manager.go b/tools/walletextension/accountmanager/account_manager.go index dd76fa4f69..a92dcf10e9 100644 --- a/tools/walletextension/accountmanager/account_manager.go +++ b/tools/walletextension/accountmanager/account_manager.go @@ -69,8 +69,9 @@ func (m *AccountManager) ProxyRequest(rpcReq *wecommon.RPCRequest, rpcResp *inte err = m.subscriptionsManager.HandleNewSubscriptions(clients, rpcReq, rpcResp, userConn) if err != nil { m.logger.Error("Error subscribing to multiple clients") + return err } - return err + return nil } return m.executeCall(rpcReq, rpcResp) } diff --git a/tools/walletextension/wallet_extension.go b/tools/walletextension/wallet_extension.go index 2affdacf6e..c76dd41454 100644 --- a/tools/walletextension/wallet_extension.go +++ b/tools/walletextension/wallet_extension.go @@ -249,6 +249,7 @@ func (w *WalletExtension) AddAddressToUser(hexUserID string, message string, sig encClient, err := common.CreateEncClient(w.hostAddr, addressFromMessage.Bytes(), privateKeyBytes, signature, w.Logger()) if err != nil { w.Logger().Error(fmt.Errorf("error creating encrypted client for user: (%s), %w", hexUserID, err).Error()) + return fmt.Errorf("error creating encrypted client for user: (%s), %w", hexUserID, err) } accManager.AddClient(addressFromMessage, encClient)