Re: Re: Exception
| From: | Anas Mughal | Date: | Mon, 05 Dec 2005 04:01:48 +0000 |
| Subject: | Re: Re: Exception | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-226854@lists.php.net to get a copy of this message | ||
I don't know about PHP, however, in other languages, exception throwing and
catching is expensive.
As Curt put it, exception handling should be reserved for truly exceptional
cases:
- DB connection failure
- SOA connectivity failure
General errors like the user not completing a form, should be handled as
regular error conditions.
Hope this helps.
On 12/4/05, Christian Herrnbock <christian@herrnboeck.ca> wrote:
>
> mr php wrote:
>
> > Hello
> > Is it good to use exception handling for error handling or I should use
> > only for exceptions?
> > For example:
> > Is it good to throwing user input errors with throw new Exception().
> > Thanks
>
> Hello,
>
> I would also go by keeping them separate; it helps both in logic-flow, and
> maintenence. Not to mention, exception handlers are design to do just that
> - handle exceptions.
>
>
> Regards,
> Christian
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Anas Mughal