|
Posted by ZeldorBlat on 09/19/06 14:42
47comput...@gmail.com wrote:
> Another question just came to me...
>
> >From within the functions in that class, can I manually throw a kind of
> custom error? Say, for example, the function runs a SELECT query on a
> database and all the code executes just fine, but no records are
> returned. For that particular function, records really _should_ be
> returned. Otherwise, something is wrong.
>
> Would there be a way, using the trapping I have in place, to throw an
> error with a custom message? Because the only other way I can think of
> doing it would be to have a function within the class that sends the
> error reports that my custom error handler sends and call that function
> within the class.
Look at trigger_error()
<http://www.php.net/trigger_error>
But you may really want to be using exceptions for the case described
above.
[Back to original message]
|