Example #1
0
 /**
  * 显示exception错误信息
  * @param LogicException $e 
  */
 function handler($e)
 {
     if ($e->getCode() == 404 && !DEBUG) {
         header("HTTP/1.0 404 Not Found");
         exit;
     }
     // 正式情况下
     $this->out['_msg'] = $e->getMessage();
     $this->out['_code'] = $e->getCode();
     // 只有LogicException才需要显示详细,记录日志
     if ($e instanceof LogicException) {
         // DEBUG时显示调试详细信息
         if (DEBUG) {
             $this->out['_exception_detail']['trace'] = $this->getTraceDesc($e->getTrace());
             $this->out['_exception_detail']['file'] = $e->getFile();
             $this->out['_exception_detail']['line'] = $e->getLine();
         } else {
             $this->out['_msg'] = '系统错误';
         }
     }
     if (!$this->tpl) {
         $this->tpl = PATH_APP . '/template/msg.tpl';
     }
     $this->display();
 }