|
Posted by 47computers on 09/19/06 14:58
> Look at trigger_error()
> <http://www.php.net/trigger_error>
>
> But you may really want to be using exceptions for the case described
> above.
This has definitely sent me in the right direction, thank you :)
Hopefully one last question: Suppose I enclose my function's code
within a try/catch. When I want to manually error out, I throw a new
Exception with the error message I want. From a design perspective,
what _should_ I be doing in that catch block?
Currently, for my testing, I'm just calling trigger_error in the catch
block to execute my custom error handler which is working like a charm.
Is this bad form in any way? This may be a silly question, but I
figure it's worth asking.
-David
Navigation:
[Reply to this message]
|