Report or log an exception.

@param  \Exception  $e
@return void
769737
public function report(Exception $e)
    {
        if ($this->shouldntReport($e)) {
            return;
        }

        if (method_exists($e, 'report')) {
            return $e->report();
        }

        try {
            $logger = $this->container->make(LoggerInterface::class);
        }
        catch (Exception $ex) {
            throw $e; // Throw the original exception
        }

        $logger->error($e);
    }
618157
public static function log(\Exception $e)
    {
        if (config('geoip.log-failures.enabled', false)) {
            $path = config('geoip.log-failures.path', storage_path('logs/geoip.log'));

            $log = new Logger('geoip');
            $log->pushHandler(new StreamHandler($path, Logger::ERROR));
            $log->addError($e);
        }
    }
1226854
public function handleException($e)
    {
        if (!$e instanceof Exception) {
            $e = new FatalThrowableError($e);
        }

        $this->getExceptionHandler()->report($e);
        $this->getExceptionHandler()->render($e);
    }
327085
public function report(Exception $e)
    {
        if ($this->shouldntReport($e)) {
            return;
        }

        if (is_callable($reportCallable = [$e, 'report'])) {
            return $this->container->call($reportCallable);
        }

        try {
            $logger = $this->container->make(LoggerInterface::class);
        } catch (Exception $ex) {
            throw $e;
        }

        $logger->error(
            $e->getMessage(),
            array_merge($this->context(), ['exception' => $e]
        ));
    }
356869
protected function logException(\Exception $exception)
    {
        $level = $this->getLogLevel();
        
        $message = sprintf('Uncaught Exception %s: "%s" at %s line %s', get_class($exception), $exception->getMessage(),
            $exception->getFile(), $exception->getLine());
        
        $context = compact('exception');

        $this->getLogger()->log($level, $message, $context);
    }
916804
public static function handle(Exception $e)
    {
        if ($e instanceof AtomikHttpException) {
            header('Location: ', false, $e->getCode());
            if ($e->getCode() === 404) {
                header('Content-type: text/html');
                if ($output = Atomik::render(self::$config['404_view'], array('exception' => $e))) {
                    echo $output;
                } else {
                    echo '<h1>Page not found</h1>';
                }
            }
        } else {
            header('Location: ', false, 500);
            if (self::$config['catch_errors']) {
                if ($output = Atomik::render(self::$config['error_view'], array('exception' => $e))) {
                    echo $output;
                } else {
                    echo self::render($e);
                }
            } else if (self::$config['throw_errors']) {
                throw $e;
            }
        }
    }
1021376
public function handleException(\Throwable $e): void
    {
        if (!$this->get('error.log', false)) {
            return;
        }

        // Do not log 4xx errors
        $code = $e->getCode();

        if ($code < 400 || $code >= 500) {
            $message = sprintf(
                'Code: %s - %s - File: %s (%d)',
                $e->getCode(),
                $e->getMessage(),
                $e->getFile(),
                $e->getLine()
            );

            $traces = '';

            foreach (BacktraceHelper::normalizeBacktraces($e->getTrace()) as $i => $trace) {
                $traces .= '    #' . ($i + 1) . ' - ' . $trace['function'] . ' ' . $trace['file'] . "\n";
            }

            $this->logger->createRotatingLogger('console-error', Core\Logger\Logger::DEBUG)
                ->error($message . "\n" . $traces, ['exception' => $e]);
        }
    }
602031
public function logError(MvcEvent $e)
    {
        /** @var \Exception $exception */
        $exception = $e->getResult()->exception;

        if (!$exception) {
            return;
        }

        $extra = [
            'file'  => $exception->getFile(),
            'line'  => $exception->getLine(),
            'trace' => $exception->getTrace()
        ];

        if ($exception instanceof ErrorException) {
            /** @var ErrorException $exception */
            $extra['severity'] = $exception->getSeverity();
        }

        $this->logger->err($exception->getMessage(), $extra);
    }
335505
protected function renderException($output, \Exception $e)
    {
        $this->app[ExceptionHandler::class]->renderForConsole($output, $e);
    }
1151999
protected function reportException(Exception $e)
    {
        $handler = $this->app->make(ExceptionHandler::class);

        $handler->report($e);
    }
1099826
public function notify(Exception $e)
    {
        $this->exception = $e;
        $this->notifier->send($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 );
	}
1289270
protected function handleException(\Exception $e)
    {
        $errors = [];

        $scannedException = $e;
        while ($scannedException) {
            $errors[] = $scannedException->getMessage();
            $errors[] = 'In ' . $scannedException->getFile() . ' on line ' . $scannedException->getLine();
            $scannedException = $scannedException->getPrevious();
        }

        return $this->notify($errors, 'error');
    }
1288508
protected function displayCliException($e)
    {
        echo 'Exception', PHP_EOL,
        $this->highlight($e->getMessage()),
        'File', PHP_EOL,
        $this->highlight($e->getFile() . ' on line ' . $e->getLine()),
        'Trace', PHP_EOL,
        $this->highlight($e->getTraceAsString());

        if ($this->autoExit) {
            exit($this->getExitCode($e));
        }
    }
1276555
public function logErrorException(\Exception $e)
    {
        if ($this->getServerContext()->hasLogger(LoggerUtils::SYSTEM)) {
            $this->getServerContext()->getLogger(LoggerUtils::SYSTEM)->error($e->__toString());
        }
    }
1062300
public function handleException(Throwable $e): void
    {
        $exceptionHandlerPath = null;

        if (($module = Application::getCurrentModule()) !== null) {
            $exceptionHandlerPath = Application::getModulePath($module) . 'controllers/ExceptionHandler.php';
            if (!is_file($exceptionHandlerPath)) {
                $exceptionHandlerPath = Application::getApplicationPath('controllers/ExceptionHandler.php');
            }
        } else {
            $exceptionHandlerPath = Application::getApplicationPath('controllers/ExceptionHandler.php');
        }

        if (is_file($exceptionHandlerPath)) {
            require_once $exceptionHandlerPath;
            $exceptionHandler = new \ExceptionHandler($e);

            if ($exceptionHandler instanceof ResponseExceptionHandler) {
                $exceptionHandler->exec();
            } else {
                $routeException = new ServerException('Your ExceptionHandler is not instance of ResponseExceptionHandler, can not continue');
                Log::emergency($routeException);
                Application::terminateWithError('Your ExceptionHandler is not instance of ResponseExceptionHandler, can not continue');
            }
        } else {
            $exceptionHandler = new ResponseExceptionHandler($e);
            $exceptionHandler->exec();
        }
    }
1016063
public function handleException(\Throwable $e) : void
    {
        $this->report($e);
        if ($this->getConfigParam('env') != 'prod') {
            throw $e;
        }
        $response = $this->throwableToResponse($e);
        $this->responseSender->sendResponse($response);
    }