Think about Loose Coupling | |
PerlMonks |
Re^2: When throw exceptions?by sundialsvc4 (Abbot) |
on Jul 10, 2012 at 17:41 UTC ( [id://980910]=note: print w/replies, xml ) | Need Help?? |
/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.
In Section
Seekers of Perl Wisdom
|
|