Skip to content

Commit

Permalink
code rabbit findings
Browse files Browse the repository at this point in the history
  • Loading branch information
otherview committed Oct 13, 2023
1 parent 3085d91 commit 288b591
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/walletextension/api/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package api
import (
"encoding/json"
"fmt"

Check failure on line 5 in tools/walletextension/api/utils.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed (gofumpt)
"github.com/obscuronet/go-obscuro/go/common/log"

Check failure on line 6 in tools/walletextension/api/utils.go

View workflow job for this annotation

GitHub Actions / lint

File is not `goimports`-ed (goimports)
"strings"

Check failure on line 7 in tools/walletextension/api/utils.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed (gofumpt)

gethlog "github.com/ethereum/go-ethereum/log"
Expand Down Expand Up @@ -109,17 +110,17 @@ func handleEthError(req *accountmanager.RPCRequest, conn userconn.UserConn, logg

errBytes, err := json.Marshal(jsonRPRCError)
if err != nil {
logger.Error("unable to marshal error - %w", err)
logger.Error("unable to marshal error - %w", log.ErrKey, err)
return
}

if err = conn.WriteResponse(errBytes); err != nil {
logger.Error("unable to write response back - %w", err)
logger.Error("unable to write response back - %w", log.ErrKey, err)
}
}

func handleError(conn userconn.UserConn, logger gethlog.Logger, err error) {
if err = conn.WriteResponse([]byte(err.Error())); err != nil {
logger.Error("unable to write response back - %w", err)
logger.Error("unable to write response back", log.ErrKey, err)
}
}

0 comments on commit 288b591

Please sign in to comment.