More output magic on nested exceptions

This commit is contained in:
Tomas V.V.Cox 2004-06-21 04:36:17 +00:00
parent 24ec6e5a5c
commit 1fb65c4c29

View file

@ -176,9 +176,10 @@ class PEAR_Exception extends Exception
private function _getCauseMessage()
{
$msg = ' ' . $this->_method . " at {$this->file} ({$this->line})\n";
$msg = " #{$this->_method} at {$this->file} ({$this->line})\n" .
" {$this->message}\n";
if ($this->cause instanceof Exception) {
return $msg . $this->cause->_getCauseMessage();
return $this->cause->_getCauseMessage() . $msg;
}
return $msg;
}