Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's a subtle problem in the proposed solution: if an error happens after you already started writing the response, you can't change the http status code.

So, what should you do with an error that happens while writing the HTTP response itself? Maybe keep statistics on how often it happens, in case happens often enough that it seems relevant for debugging. But there's no good way to report an error to the client because the network connection is likely broken.

If you're not going to keep statistics, dropping errors from writing an http response is reasonable and arguably correct.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: