From 9f023cafaf29b969c8f2ef8af0b2b4af8289ae08 Mon Sep 17 00:00:00 2001 From: Peter Broadhurst Date: Tue, 30 Aug 2022 11:07:36 -0400 Subject: [PATCH] Add underlying error to FF22012 Signed-off-by: Peter Broadhurst --- internal/signermsgs/en_error_messges.go | 2 +- pkg/rpcbackend/backend.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/signermsgs/en_error_messges.go b/internal/signermsgs/en_error_messges.go index 07ab7d6f..456e86bc 100644 --- a/internal/signermsgs/en_error_messges.go +++ b/internal/signermsgs/en_error_messges.go @@ -29,7 +29,7 @@ var ffe = func(key, translation string, statusHint ...int) i18n.ErrorMessageKey var ( MsgInvalidOutputType = ffe("FF22010", "Invalid output type: %s") MsgInvalidParam = ffe("FF22011", "Invalid parameter at position %d for method %s: %s") - MsgRPCRequestFailed = ffe("FF22012", "Backend RPC request failed") + MsgRPCRequestFailed = ffe("FF22012", "Backend RPC request failed: %s") MsgReadDirFile = ffe("FF22013", "Directory listing failed") MsgWalletNotAvailable = ffe("FF22014", "Wallet for address '%s' not available") MsgWalletFailed = ffe("FF22015", "Wallet for address '%s' could not be initialized") diff --git a/pkg/rpcbackend/backend.go b/pkg/rpcbackend/backend.go index 2c51880b..733ba43d 100644 --- a/pkg/rpcbackend/backend.go +++ b/pkg/rpcbackend/backend.go @@ -143,7 +143,7 @@ func (rc *RPCClient) SyncRequest(ctx context.Context, rpcReq *RPCRequest) (rpcRe // Restore the original ID rpcRes.ID = rpcReq.ID if err != nil { - err := i18n.NewError(ctx, signermsgs.MsgRPCRequestFailed) + err := i18n.NewError(ctx, signermsgs.MsgRPCRequestFailed, err) log.L(ctx).Errorf("RPC[%s] <-- ERROR: %s", rpcTraceID, err) rpcRes = RPCErrorResponse(err, rpcReq.ID, RPCCodeInternalError) return rpcRes, err