Skip to content

Commit

Permalink
Fix/dont mock decode err in api (#902)
Browse files Browse the repository at this point in the history
* fix(api) not mock error_text in api response
  • Loading branch information
kissken authored Aug 30, 2023
1 parent 6bb22d4 commit 75f35e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/middleware/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func getErrorResponseIfItHas(writer http.ResponseWriter) *api.ErrorResponse {
return &api.ErrorResponse{
HTTPStatusCode: http.StatusInternalServerError,
Err: err,
ErrorText: err.Error(),
}
}

Expand Down Expand Up @@ -125,6 +126,7 @@ func (entry *apiLoggerEntry) write(status, bytes int, elapsed time.Duration, res
errorResponse := getErrorResponseIfItHas(response)
if errorResponse != nil {
event.Error(errorResponse.Err)
event.String("error_text", errorResponse.ErrorText)
}
} else {
event = entry.logger.Info()
Expand Down

0 comments on commit 75f35e1

Please sign in to comment.