On Wednesday, 14 January 2015 at 17:45:28 UTC, deadalnix wrote:
It is an example "I have no idea what to do about this". The code throwing the exception is faced with a situation where it cannot continue (assuming this code is expected to generate a webpage or something like that) but at the same time, is not in a position to perform the custom http so it is bailing out.

No, "201" means success, resource created, and "409" means that it was not carried out because of conflict in the request. However, these may be meaningful responses to the client based on the input, like "204" no content. So it is output.

Throwing an exception is just an efficient way to abort all resources and queries that may be in progress and return a status to the client in a clean fashion when you don't need a text body. Just a mechanism. And it makes sense if used consistently.

Reply via email to