Actually serialize errors on bad JSON POST response
This commit is contained in:
parent
7f90391ecd
commit
c41154a200
1 changed files with 1 additions and 0 deletions
|
|
@ -252,6 +252,7 @@ func handlerJSONPost[RequestType any, ResponseType any](f handlerFunctionPost[Re
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
resp, e := f(ctx, r, *req)
|
resp, e := f(ctx, r, *req)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
|
serializeError(w, e)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
body, err := json.Marshal(resp)
|
body, err := json.Marshal(resp)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue