3 ms·
I agree with this. I usually wrap my HTTP handlers in a function that copies the error to the HTTP response, and can then just return an error from my actual h
by jrockway 3y ago
I agree with this. I usually wrap my HTTP handlers in a function that copies the error to the HTTP response, and can then just return an error from my actual handler.
I think it's fair to not force this in the standard library. HTTP doesn't have the concept of errors; just a status code, headers, and body (ok ok, and 93 other fun things you can do; chunked responses, upgrades, etc.). If you want to write the wrapper, write the wrapper. If you don't, don't.