You are here: Re: Error Trapping Within Classes « PHP Programming Language « IT news, forums, messages
Re: Error Trapping Within Classes

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация