Write to the error log if displayErrorDetails is false.

@param Throwable $e
485290
protected function logError(Throwable $e)
    {
        if ($this->settings['displayErrorDetails']) {
            return;
        }

        if (!$this->logger) {
            return;
        }

        static $errorsLogged = [];

        // Get hash of Throwable object
        $errorObjectHash = spl_object_hash($e);

        // check: only log if we haven't logged this exact error before
        if (!isset($errorsLogged[$errorObjectHash])) {
            // Log
            $this->logger->error(get_class($e), ['exception' => $e]);

            // Save information that we have logged this error
            $errorsLogged[$errorObjectHash] = true;
        }
    }
638829
public function renderException(\Exception $e, OutputInterface $output)
    {
        parent::renderException($e, $output);

        if (is_callable($this->exceptionHandler)) {
            try {
                if (method_exists($this->exceptionHandler, '__invoke')) {
                    $this->exceptionHandler->__invoke($e);
                } else {
                    call_user_func($this->exceptionHandler, $e);
                }
            } catch (\Exception $e) {
            }
        }
    }
1296551
public function handleException( \Throwable $e ) : bool
    {
        try{
            // Render exception
            $output = $this->renderer->output( $e );
    
            // make directory
            $dir = $this->file->getParent();
    
            if (!$dir->exists()){
                $dir->makeDirectory();
            }
    
            // output
            $this->file->putContents($output);
        }
        catch(\Throwable $e){
            exit($e->getMessage());
        }
    
        return true;
    }
209466
public function setException(exception $e)
    {
        if (isset($this->response)) {
            $this->response->setException($e);
        } else {
            throw $e;
        }
    }
551385
public function logServerError(Throwable $e)
    {
        if ($this->isInTesting()) {
            return;
        }

        $exception = $this->normalizeException($e);
        $this->container->make(ConsoleOutput::class)
            ->writeln(sprintf("<error>%s</error>", $exception));

        $this->container->make(ExceptionHandler::class)
            ->report($exception);
    }
808666
protected function manageException(OutputInterface $output, Exception $e)
    {
        $handler = $this->getExceptionHandler();

        $handler->report($e);

        $handler->renderForConsole($output, $e);
    }
21067
public function handleError(HTTPInputRequest $request, HTTPOutputResponse $response, \Throwable $e) : void
    {
        if ($e instanceof HTTPError) {
            $e->generateErrorResponse();
        }
        #$error = (new HTTPServerError([], $e->getMessage()))->generateErrorResponse();
        throw $e;
    }
857724
public function report(Exception $e)
    {
        if ($this->shouldntReport($e)) {
            return;
        }

        try {
            if ($this->plugin->bound('bugsnag.multi')) {
                $logger = $this->plugin->make('bugsnag.multi');
            } else {            
                $logger = $this->plugin->make('Psr\Log\LoggerInterface');
            }
            $logger->error($e);

        } catch (Exception $ex) {
            throw $e; // throw the original exception
        } finally {
            $this->renderException($e);
        }
    }
1053403
protected function writeErrorAndDie(InvalidFileException $e)
    {
        $output = (new ConsoleOutput)->getErrorOutput();

        $output->writeln('The environment file is invalid!');
        $output->writeln($e->getMessage());

        die(1);
    }
340649
public function handleException($e)
    {
        if (!$e instanceof Exception) { // Since PHP 7, in addition to an Exception, an internal Error may occur.
            // Convert the Error to ErrorException
            $e = new ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine()); // @codeCoverageIgnore
        } // @codeCoverageIgnore

        $this->getExceptionHandler()->handle($e);
    }
945758
protected function error(\Throwable $exception)
    {
        if ($this->errorHandler === null) {
            throw $exception;
        }

        ($this->errorHandler)($exception);
    }
1249990
public function failed($e)
    {
        $this->markAsFailed();

        $payload = $this->payload();

        list($class, $method) = $this->parseJob($payload['job']);

        if (method_exists($this->instance = $this->resolve($class), 'failed')) {
            $this->instance->failed($payload['data'], $e);
        }
    }
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();
        }
    }
64344
public function writeException(Exception $e)
    {
        $class = get_class($e);
        $text = $this->adapter->colorize("Exception - $class:\n{$e->getMessage()}\n", ColorInterface::LIGHT_RED);

        if ($this->isVerbose()) {
            $text .= "\n" . $this->renderTrace($e->getTrace()) . "\n";

            if ($this->isVeryVerbose() && ($previous = $e->getPrevious())) {
                $text .= "\n" . $this->adapter->colorize('Previous Exceptions:', ColorInterface::YELLOW) . "\n\n";

                do {
                    $class = $this->adapter->colorize(get_class($previous), ColorInterface::YELLOW);
                    $msg = $this->adapter->colorize($previous->getMessage(), ColorInterface::GRAY);
                    $text .= sprintf('%s: %s', $class, $msg)
                           . "\n" . $this->renderTrace($e->getTrace()) . "\n\n";
                } while ($previous = $previous->getPrevious());
            }
        }

        $this->adapter->writeLine($text);
    }
877048
protected function handleException($e)
    {
        if (isset($this->exceptions)) {
            $this->exceptions->report($e);
        }

        if ($this->causedByLostConnection($e)) {
            $this->shouldQuit = true;
        }
    }
814512
protected function handleError(Exception $e)
    {
        if($this->isCli){
            $errorCode = $e->getCode();
            exit((empty($errorCode)) ? 1 : $errorCode);	//exit the program with an error
        }
        else {
            throw new Exception($e->getMessage());
        }
    }
496882
protected function writeToErrorLog($throwable) {
		$message = 'Wiggum Application Error:' . PHP_EOL;
	
		$message .= $this->renderErrorAsText($throwable);
		while ($throwable = $throwable->getPrevious()) {
			$message .= PHP_EOL . 'Previous error:' . PHP_EOL;
			$message .= $this->renderErrorAsText($throwable);
		}
	
		$this->logError($message);
	}