In this situation you are offloading the setting to the user which could
be cumbersome.
I guess now that ive got 2 eyes fixed on the current solution, I wonder
why ::exception lives in the Zend class and not in the Zend_Exception
class? Wouldn't it make more sense to have
Zend_Exception::factory($class, $message); ?
This factory method would do the trace lookback (after parent Exception
construction) to determine the line and file number that called it, and
perhaps that is stored in local protected variables $callerFile, and
$callerLine.
I guess I could sort of understand the arguement that Zend::exception()
is easier to write than Zend_Exception::factory, but to me, I opt for
logical organization over convienence at the core level. After this is
written, this code wont change much in the library.
My 2cents ;)
-ralph
John Coggeshall wrote:
Exception() base doesn't include the method, but the properties ($e->line,
and $e->file I *believe*, check the docs) are protected so you should be
able to implement your own setFile() and setLine() methods from the extended
Zend_Exception.
John
--
John Coggeshall
Team Lead NA Pro. Services
Zend Technologies