Skip to content

Commit

Permalink
use error for err res
Browse files Browse the repository at this point in the history
  • Loading branch information
sideninja committed May 22, 2024
1 parent 13a5a9b commit a16919f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,17 @@ func (w *loggingResponseWriter) Write(data []byte) (int, error) {
_ = json.Unmarshal(data, &body)
delete(body, "jsonrpc")

w.logger.
Debug().
Fields(body).
Msg("API response")
if body["error"] != nil {
w.logger.
Error().
Fields(body).
Msg("API response")
} else {
w.logger.
Debug().
Fields(body).
Msg("API response")
}

return w.ResponseWriter.Write(data)
}
Expand Down

0 comments on commit a16919f

Please sign in to comment.