Final tweak. Slightly better formatting for returned message

This commit is contained in:
dtookey 2022-11-16 11:15:06 -05:00
parent 3a7077f2d5
commit b11be2f32c

View File

@ -112,7 +112,8 @@ func (s *VinegarServlet) SendError(w http.ResponseWriter, req *http.Request, cod
return return
} else { } else {
w.WriteHeader(code) w.WriteHeader(code)
genericError, sErr := json.Marshal(msg) errorPayload := ErrorResponse{Code: code, Message: msg}
genericError, sErr := json.Marshal(errorPayload)
if sErr != nil { if sErr != nil {
panic(sErr) panic(sErr)
} }