4 ms·
>Why give out an error at all? Because that is useful information. What benefit is there to hiding the information?
by papsosouid 13y ago
>Why give out an error at all?
Because that is useful information. What benefit is there to hiding the information?
- strickjb9 13y agoI draw the line on what a real error - 4xx doesn't seem to fit the bill. If you want information then a 2xx code and/or a JSON body would be ideal (for me). I think this is the crux of the debate is where do you draw the line?
- papsosouid 13y agoThat doesn't make any sense. The line was already drawn, in the HTTP spec. Follow it. Returning 200 OK for everything and then putting an error in the the body is completely useless. The whole point is that there are common, well defined errors which HTTP specifies codes for. Clients can properly handle those errors regardless of what the backend is like. Nobody wants to have to write millions of different solutions to parse your JSON error responses and figure out what they mean and what to do with them.