Actually serialize errors on bad JSON POST response

This commit is contained in:
Eli Ribble 2026-04-08 17:27:51 +00:00
parent 7f90391ecd
commit c41154a200
No known key found for this signature in database

View file

@ -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)