Beispiel #1
0
 /**
  * @param bool $forceKill
  */
 public static function handleShutdown($forceKill = false)
 {
     $err = error_get_last();
     try {
         self::handleError($err['type'], $err['message'], $err['file'], $err['line']);
     } catch (Error $ex) {
         echo \Surume\Throwable\Error::toString($ex) . PHP_EOL;
     } catch (Exception $ex) {
         echo \Surume\Throwable\Exception::toString($ex) . PHP_EOL;
     }
     if ($forceKill) {
         posix_kill(posix_getpid(), 9);
     }
 }
Beispiel #2
0
 /**
  * @param Error|Exception $ex
  * @param mixed[] $params
  * @return mixed
  */
 protected function handler($ex, $params = [])
 {
     $this->logger->log($this->context['level'], \Surume\Throwable\Exception::toString($ex));
 }