Improve logging of API errors. (#553)
Previously errors would look like: ERRO[0008] api error: {bad_data 0xc4201caae0} source=api.go:534 Now they look like: ERRO[0001] api error: bad_data: json: cannot unmarshal object into Go value of type []*types.Alert source=api.go:534
This commit is contained in:
parent
b640c219e5
commit
406aacf141
|
@ -531,7 +531,7 @@ func respondError(w http.ResponseWriter, apiErr apiError, data interface{}) {
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
log.Errorf("api error: %s", apiErr)
|
||||
log.Errorf("api error: %v", apiErr.Error())
|
||||
|
||||
w.Write(b)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue