Re: exceptions

From: Date: Tue, 08 Jun 2004 14:02:41 +0000
Subject: Re: exceptions
References: 1 2 3 4 5 6 7 8 9  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-30171@lists.php.net to get a copy of this message
Hans Lellelid wrote:
Hmm I think you dont understand what I meant when I said "misuse
exceptions for code flow". With that I mean using exceptions as a means to jump out of a given context while passing along data where no error occured.
Right, of course they should only be used for errors .... I'm not arguing that exceptions should be used for flow control in a non-error context. I think most if not all developers will agree on that one. There are certainly some grey areas ... e.g. should a ValidationException be thrown from a validate() method? Probably not, but perhaps it does make sense to throw such an exception from a save() method. Anyway, no one ( at least not me ) is arguing for abuse of exceptions by throwing them when no error actually occurred.
Ok, good to know that we are on the same page there :-) regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

« previous php.pear.dev (#30171) next »