Skip to content

Commit

Permalink
Cosmetic change
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Nov 25, 2021
1 parent e0dfa1f commit f6a6d77
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/http/services/ocmd/reqres.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ type APIError struct {
}

// WriteError handles writing error responses
func WriteError(w http.ResponseWriter, r *http.Request, code APIErrorCode, message string, err error) {
if err != nil {
appctx.GetLogger(r.Context()).Error().Err(err).Msg(message)
func WriteError(w http.ResponseWriter, r *http.Request, code APIErrorCode, message string, e error) {
if e != nil {
appctx.GetLogger(r.Context()).Error().Err(e).Msg(message)
}

var encoded []byte
var err error
w.Header().Set("Content-Type", "application/json")
encoded, err = json.MarshalIndent(APIError{Code: code, Message: message}, "", " ")

Expand Down

0 comments on commit f6a6d77

Please sign in to comment.