Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://980910]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-23 11:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found