From eb4cbb94f00d70fb5f041f18a13d9ce3f8fea85f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDiga=20Kokelj?= Date: Wed, 1 Nov 2023 11:22:45 +0100 Subject: [PATCH 1/2] return error instead of just logging it --- tools/walletextension/accountmanager/account_manager.go | 1 + tools/walletextension/wallet_extension.go | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/walletextension/accountmanager/account_manager.go b/tools/walletextension/accountmanager/account_manager.go index dd76fa4f69..d63cff7df2 100644 --- a/tools/walletextension/accountmanager/account_manager.go +++ b/tools/walletextension/accountmanager/account_manager.go @@ -69,6 +69,7 @@ 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 } diff --git a/tools/walletextension/wallet_extension.go b/tools/walletextension/wallet_extension.go index 2affdacf6e..84dc590156 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 errors.New(fmt.Errorf("error creating encrypted client for user: (%s), %w", hexUserID, err).Error()) } accManager.AddClient(addressFromMessage, encClient) From ba2aa03de0ba33e67999a6c0937a1dd067b7afee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDiga=20Kokelj?= Date: Wed, 1 Nov 2023 11:25:07 +0100 Subject: [PATCH 2/2] fix --- tools/walletextension/accountmanager/account_manager.go | 2 +- tools/walletextension/wallet_extension.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/walletextension/accountmanager/account_manager.go b/tools/walletextension/accountmanager/account_manager.go index d63cff7df2..a92dcf10e9 100644 --- a/tools/walletextension/accountmanager/account_manager.go +++ b/tools/walletextension/accountmanager/account_manager.go @@ -71,7 +71,7 @@ func (m *AccountManager) ProxyRequest(rpcReq *wecommon.RPCRequest, rpcResp *inte 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 84dc590156..c76dd41454 100644 --- a/tools/walletextension/wallet_extension.go +++ b/tools/walletextension/wallet_extension.go @@ -249,7 +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 errors.New(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)