/** * 简单的自定义处理handler的方法handlerIndex * 可以不用exceptionHandler类下处理,但前提你你知道自己在做什么 * @param type $e */ static function handlerIndex($e) { $excepHandler = new ExceptionHandler(); $excepHandler->out['_url'][] = array('url' => '/', 'text' => '返回首页'); $excepHandler->out['_url'][] = array('url' => '/', 'text' => '返回上页'); $excepHandler->tpl = PATH_APP . '/template/index_msg.tpl'; $excepHandler->handler($e); }
public function doTick() { if (!$this->rakLib->isTerminated()) { $this->interface->sendTick(); } else { $info = $this->rakLib->getTerminationInfo(); $this->network->unregisterInterface($this); \ExceptionHandler::handler(E_ERROR, "RakLib Thread crashed [" . $info["scope"] . "]: " . (isset($info["message"]) ? $info["message"] : ""), $info["file"], $info["line"]); } }
public function process() { $work = false; if ($this->interface->handlePacket()) { $work = true; while ($this->interface->handlePacket()) { } } if ($this->rakLib->isTerminated()) { $info = $this->rakLib->getTerminationInfo(); $this->network->unregisterInterface($this); \ExceptionHandler::handler(E_ERROR, "RakLib Thread crashed [" . $info["scope"] . "]: " . (isset($info["message"]) ? $info["message"] : ""), $info["file"], $info["line"]); } return $work; }
/** * 默认处理exception的方法 * @param Exception $e */ function exception_handler(Exception $e) { $exceptionHandler = new ExceptionHandler(); $exceptionHandler->handler($e); }
public static function SetExceptionHandler(ExceptionHandler $handler) { self::$handler = $handler; }
/** * Set exception handler. * * @return void */ public final function setExceptionHandler() { set_exception_handler(ExceptionHandler::handler()); }