Reply to PHP5 silently throwing exceptions???

Your name:

Reply:


Posted by Gerard Samuel on 01/15/05 20:00

Im currently using php 5.0.3 on a dev box,
trying to figure out how to correctly use
exceptions in my code.
Per chance, I was monitoring the __autoload() function,
and Im noticing that calls are being made to
exception classes that I've setup.
But nothing is being actually thrown.
As I understand it, __autoload(), only gets called, if a class
file hasn't been loaded for a class.
I know for a fact that all my exception classes are derived from
php's Exception class.
I've debugged it down to this ->
//try
//{
$db->connect();
//}
//catch(databaseException $e)
//{
// throw $e;
//}

The ::connect() method is supposed to throw a databaseException if a
connection cannot be made.
In my tests, connections are made, and the exception is not thrown.
But the try/catch block above, for some reason, tries to throw
the databaseException (according to __autoload()).
If I comment it out the try/catch block, __autoload()
doesn't try to load the databaseException object.

I dont know if this is a bug in my code, as Im still new to exceptions.
Im just checking to see if anyone else experienced anything like
this before...

Thanks

[Back to original 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

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