in reply to Re: When throw exceptions?
in thread When throw exceptions?
/me nods...
And I would have been one of those dissenting voices in your review committee. If you had told me that the returned object was some kind of a status record, I might have asked why you then did not simply return one structure (like a typical JSON response structure) in which both the status and the result were part of a single record/hash. If it were an error, and (I am not knowledgeable of Dancer) it was not a situation very much like that of a JSON response, I, too, would have advocated the throw-an-exception mechanism because of its ability to circumvent “all those tests.” (Then I would have listened, attentively, to your counter-argument, and have been fully prepared to reverse my position in your favor.)
I entirely agree with your closing comment, however: make a decision, and thereafter be consistent.