Ben Sgro wrote:
try
{
call_user_func($faSet, $this->getArguments($argSet));
}
catch ( customException $e )
{
throw new $exceptionToThrow;
}
On Dec 14, 2007, at 2:59 PM, Ben Sgro wrote:
I want to set the customException dynamically.
I tried doing so by passing it in as a var ... catch ($var $e)
but that didn't seem to work.
Can it be done?
I'm not sure... seems somewhat odd that you would need to do that...
You could catch Exception which would get you everything and then use
a switch on get_class:
try {
// something
} catch (Exception $e) {
switch (get_class($e)) {
default:
// blah
break;
case $customException:
// handle it
break;
}
}
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php