Skip to content

Commit

Permalink
Merge pull request #92 from openinfradev/minor_fix
Browse files Browse the repository at this point in the history
trivial. logging every error response for management
  • Loading branch information
ktkfree authored Jun 22, 2023
2 parents 9dbe2a1 + 69bda8a commit 394693c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/delivery/http/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ func init() {
}

func ErrorJSON(w http.ResponseWriter, r *http.Request, err error) {
log.ErrorfWithContext(r.Context(), "error is :%s(%T)", err.Error(), err)
errorResponse, status := httpErrors.ErrorResponse(err)
ResponseJSON(w, r, status, errorResponse)
}

const MAX_LOG_LEN = 500
const MAX_LOG_LEN = 1000

func ResponseJSON(w http.ResponseWriter, r *http.Request, httpStatus int, data interface{}) {
out := data
Expand Down

0 comments on commit 394693c

Please sign in to comment.