3 ms·
Distilled, it’s the wet dream of mapping errors/exceptions to http codes. I just decided that 200 ok, 400 you, 500 me is enough for non-file and/or non-browser-
by wruza 3y ago
Distilled, it’s the wet dream of mapping errors/exceptions to http codes. I just decided that 200 ok, 400 you, 500 me is enough for non-file and/or non-browser-itself-requested-it requests. And I like much more when API docs don’t require me to set switch-cases around their return codes, because it all ends up in a single “if not 200, log status and body and throw/return '{you|me} failed'”.
Moreover, I’ve seen things returning e.g. an array of >0 orders with 200 and an empty array with 404. This makes me emotional and breaks HN guidelines.