Re: did i understood error handling guidelines correct?
| From: | Sebastian Mendel | Date: | Fri, 13 Jul 2007 09:03:29 +0000 |
| Subject: | Re: did i understood error handling guidelines correct? | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-47458@lists.php.net to get a copy of this message | ||
cweiske schrieb:
> Sebastian,
>
>>> Your SQL Parser seems to throw exceptions which is correct.
>>> (It should use an own exception class that extends PEAR_Exception)
>
>> should or must? and why?
>> what is expected from my own Exception different then PEAR_Exception?
>> just the name?
>
> If you have a package that utilizes multiple packages, e.g. in a method:
>
> function doSomething() {
> OtherPackage::curse();
> EvenDifferentPackage::sleep();
> }
>
> then you can try/catch based on the exception type and distinguish in your own code if the
> exception has been thrown in OtherPackge or in EvenDifferentPackage and react on it differently -
> e.g. because an exception in OtherPackage may occur and is not bad (e.g. config could not be
> loaded), while an Exception in EvenDifferentPackage is very, very bad and needs admin interaction.
ah, ok, so i think it is fine as i have done it, cause it is not the package
just an 'executable'
in the package i will use own exception
--
Sebastian Mendel
www.sebastianmendel.de