Beispiel #1
0
Datei: H.php Projekt: HWeiXin/wx
 /**
  * 异常处理
  * @param HException $exception
  */
 public function handleException($exception)
 {
     $code = $exception->getCode();
     //服务器错误
     if ($code == 500) {
         Controller::renderErr($exception->getMessage(), $exception->getFile(), $exception->getLine(), $exception->data);
     } elseif ($this->_h_config['is_log']) {
         $log = 'Exception Code[' . $code . '] Msg[' . $exception->getMessage() . '] ' . $exception->getFile() . ' on line ' . $exception->getLine();
         HLog::model()->add($log, HLog::LEVEL_ERROR);
         HLog::model()->save();
     }
 }