Preflight checklist
Describe the bug
I noticed by using the (h *JSONWriter) WriteErrorCode function, that the header is correctly set, but the JSON response returns a 500 status code and message.
Is this a bug or am i interpreting the purpose of the function wrong?
Reproducing the bug
h.d.Writer().WriteErrorCode(w, r, 401, errors.New("error"))
Response:

Version
v0.10.2
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
None
Additional Context
My workaround right now:
h.d.Writer().WriteError(w, r, herodot.DefaultError{
CodeField: 401,
ErrorField: errors.New("error"),
})
Preflight checklist
Describe the bug
I noticed by using the (h *JSONWriter) WriteErrorCode function, that the header is correctly set, but the JSON response returns a
500status code and message.Is this a bug or am i interpreting the purpose of the function wrong?
Reproducing the bug
Response:

Version
v0.10.2
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
None
Additional Context
My workaround right now: