Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
Minor tweak in error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
latenssi committed Apr 30, 2021
1 parent a96117f commit c5bda00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion account/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (s *Service) Details(ctx context.Context, address string) (account data.Acc
func (s *Service) ValidateAddress(address string) (err error) {
flowAddress := flow.HexToAddress(address)
if !flowAddress.IsValid(s.chainId) {
err = fmt.Errorf("'address': %s is not a valid address in '%s' chain", address, s.chainId)
err = fmt.Errorf("'%s' is not a valid address in '%s' chain", address, s.chainId)
}
return
}
6 changes: 3 additions & 3 deletions handlers/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (s *Accounts) List(rw http.ResponseWriter, r *http.Request) {
s.l.Println("List accounts")
accounts, err := s.as.List(context.Background())
if err != nil {
s.l.Printf("Error: %s\n", err)
s.l.Printf("Error: %v\n", err)
rw.WriteHeader(http.StatusInternalServerError)
rw.Write([]byte("Error"))
return
Expand All @@ -37,7 +37,7 @@ func (s *Accounts) Create(rw http.ResponseWriter, r *http.Request) {
s.l.Println("Create account")
account, err := s.as.Create(context.Background())
if err != nil {
s.l.Printf("Error: %s\n", err)
s.l.Printf("Error: %v\n", err)
rw.WriteHeader(http.StatusInternalServerError)
rw.Write([]byte("Error"))
return
Expand All @@ -52,7 +52,7 @@ func (s *Accounts) Details(rw http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
account, err := s.as.Details(context.Background(), vars["address"])
if err != nil {
s.l.Printf("Error: %s\n", err)
s.l.Printf("Error: %v\n", err)
rw.WriteHeader(http.StatusInternalServerError)
rw.Write([]byte("Error"))
return
Expand Down

0 comments on commit c5bda00

Please sign in to comment.