Записывает сообщение об исключении в журнал

@param Exception $e

@since 3.01
770019
public static function logException($e)
    {
        $previous = $e->getPrevious();
        $trace = $e->getTraceAsString();

        $logMessage = sprintf(
            "%s in %s at %s\n%s\nBacktrace:\n%s\n",
            get_class($e),
            $e->getFile(),
            $e->getLine(),
            $e->getMessage(),
            $trace
        );

        Eresus_Kernel::log(__METHOD__, LOG_ERR, $logMessage);

        if ($previous)
        {
            self::logException($previous, 'Previous exception:');
        }
    }
551985
protected function prepareException(Exception $e)
    {
        if ($e instanceof ModelNotFoundException) {
            $e = new NotFoundHttpException($e->getMessage(), $e);
        } elseif ($e instanceof AuthorizationException) {
            $e = new AccessDeniedHttpException($e->getMessage(), $e);
        } elseif ($e instanceof TokenMismatchException) {
            $e = new HttpException(419, $e->getMessage(), $e);
        }

        return $e;
    }
1276555
public function logErrorException(\Exception $e)
    {
        if ($this->getServerContext()->hasLogger(LoggerUtils::SYSTEM)) {
            $this->getServerContext()->getLogger(LoggerUtils::SYSTEM)->error($e->__toString());
        }
    }
749347
public static function log(Exception $e)
    {
        Base::getLog()->error($e->getMessage(), [
            'code' => $e->getCode(),
            'file' => $e->getFile(),
            'line' => $e->getLine(),
        ]);
    }
1084883
public function handleException(\Exception $e)
    {
        // 禁用错误获取
        restore_error_handler();
        restore_exception_handler();

        try {
            // 获取错误句柄
            $handler = $this->getErrorHandler();
            // 处理错误句柄之前的事件执行
            if ($this->hasEventHandler('beforeErrorHandle')) {
                $this->onBeforeErrorHandle(new Event($this));
            }
            // 错误句柄执行
            if (null !== $handler) {
                $handler->handleException($e);
            } else {
                $this->displayException($e);
            }
        } catch (\Exception $e) {
            $this->displayException($e);
        }
        $this->end(1);
    }
1169916
protected function processException(Exception $e)
    {
        $this->_lastRenderError = $e;

        if ($this->_errorListener) {
            call_user_func($this->_errorListener, $e, $this);
        }

        return '';
    }
289753
public function error(\Exception $e)
    {
        if ($this->beep_on_error === true) {
            \Commando\Util\Terminal::beep();
        }

        if ($this->trap_errors !== true) {
            throw $e;
        }

        $color = new \Colors\Color();
        $error = sprintf('ERROR: %s ', $e->getMessage());
        echo $color($error)->bg('red')->bold()->white() . PHP_EOL;
        exit(1);
    }
202315
private function handleExternalError(\Exception $e) {
        $reflection = new \ReflectionClass($e);
        echo '<header>';
            echo '<h1>Exception: ' . $reflection->getName() . '</h1>';
            echo '<h2>Message: ' . $e->getMessage() . '</h2>';
            echo '<h3>' . $e->getFile() . ':' . $e->getLine() . '</h3>';
        echo '</header>';
        if ( method_exists($e, 'getContext') ) {
            echo 'Debug:';
            !d( $e->getContext() );
        }
    }
300901
public function report(Exception $e)
    {
        if ($this->exceptionHandler !== null) {
            $this->exceptionHandler->report($e);
        }
    }
737008
public static function run( \Exception $e )
	{
		$config = config('system.errors');
		if (($config['display'] || is_a( $e, Message::class )) && !($e instanceof QueryException)) {
			$obj = new Response( self::getErrorObject($e), ($e->getCode() ? $e->getCode() : 500) );
		} else {
			$obj = new Response( $e->getMessage(), 500 );
		}
		if ($config['log']) {
			self::logObject($e);
		}
		self::sendResponse( $obj );
	}
844262
protected function handleException($request, Exception $e)
    {
        $handler = $this->app->make(ExceptionHandler::class);

        return $handler->render($request, $e);
    }
366730
public function on_exception( $e ) {

		// Log the PHP exception.
		do_action(
			\Inpsyde\Wonolog\LOG,
			new Log(
				$e->getMessage(),
				Logger::CRITICAL,
				Channels::PHP_ERROR,
				[
					'exception' => get_class( $e ),
					'file'      => $e->getFile(),
					'line'      => $e->getLine(),
					'trace'     => $e->getTraceAsString(),
				]
			)
		);

		// after logging let's reset handler and throw the exception
		restore_exception_handler();
		throw $e;
	}
1119295
public function handle(\Exception $e) {

		try {
			ob_clean();
			$this->createResponse($e)->send();
		}
		
		catch(\Exception $e) {
			printf('Exception thrown when handling exception (%s: %s)', get_class($e), $e->getMessage());
			exit();
		}

	}
45791
protected function shouldCatch(\Exception $e)
    {
        foreach ($this->exceptionClasses as $exceptionClass) {
            if (is_a($e, $exceptionClass, true)) {
                return true;
            }
        }

        return false;
    }
1167634
public static function exceptionHandler(\Exception $e)
    {
//echo __METHOD__;
        $error = Error::createFromException($e, Response::STATUS_ERROR);
        $status = method_exists($e, 'getStatus') ? $e->getStatus() : Response::STATUS_ERROR;
        Container::get('response')
            ->setStatus($status);
        Container::get('controller')
            ->addError($error)
            ->serve();
    }
225836
public function formatException(\Exception $e) {
        $entry = array();

        $entry['class'] = get_class($e);
        $entry['message'] = $e->getMessage();
        $entry['file'] = $e->getFile();
        $entry['line'] = $e->getLine();
        $entry['trace'] = $e->getTraceAsString();

        return $entry;
    }
815951
public function report(Exception $e)
    {
        if ($this->shouldReport($e)) {
            $class = addslashes(get_class($e));
            $message = addslashes($e->getMessage());
            $file = addslashes($e->getFile());
            $line = addslashes($e->getLine());
            $time = date('c');
            // log locally
            $log = sprintf("[%s] [%s] %s thrown in %s on line %d\n", $time, $class, $message, $file, $line);
            error_log($log, 3, $this->di->logPath() . DIRECTORY_SEPARATOR . '/pails.error.log');
            // log to system
            $syslog = sprintf('[%s] %s thrown in %s on line %d', $class, $message, $file, $line);
            error_log($syslog);
        }
    }