* @license PHP License * @package WB * @subpackage base */ /** * specific handler for exceptions * * @version 0.1.1 * @package WB * @subpackage base */ class WBErrorHandler_Exception extends WBErrorHandler { /** * Static constructor * * Sets up exception handler */ static public function staticConstruct() { $me = new WBErrorHandler_Exception(); set_exception_handler(array($me, 'handle')); } /** * handle php errors * * @param object $e exception object * @see set_exception_handler() */ public function handle($e) { if (!$this->checkLogger()) { echo $e->getMessage() . "
\n"; $this->kill(); return; } $log = array( 'type' => 'exception', 'msg' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), ); WBLog::start('error')->err($log); $backtrace = $e->getTrace(); $this->logBacktrace($backtrace); $this->kill(); } } ?>