Generates a message in the error log when an error occured.

@param Item $itemToIndex
@param \Exception  $e
344697
protected function generateIndexingErrorLog(Item $itemToIndex, \Exception $e)
    {
        $message = 'Failed indexing Index Queue item ' . $itemToIndex->getIndexQueueUid();
        $data = ['code' => $e->getCode(), 'message' => $e->getMessage(), 'trace' => $e->getTraceAsString(), 'item' => (array)$itemToIndex];

        $this->logger->log(
            SolrLogManager::ERROR,
            $message,
            $data
        );
    }
1092446
protected function exceptionMessage(\Exception $e)
    {
        return get_class($e) . ' in ' . $e->getFile() . ':' . $e->getLine() . ' "' . $e->getMessage() . '"';
    }
74359
public function getErrorInfo(array $itemArray, array $itemInfo)
    {
        $errorInfo              = parent::getErrorInfo($itemArray, $itemInfo);
        $errorInfo['paramName'] = $itemArray['name'];

        return $errorInfo;
    }
1170368
public function onTranscodeFailure(TranscodeEvent $e)
    {
        $inpath = $e->getInputPath();
        $errorMsg = $e->getException()->getMessage();

        $formatter = $this->getFormatter();
        $msg = sprintf(
            "Transcode of %s failed!  Message: %s",
            $formatter->formatBlock($inpath, 'info'),
            $formatter->formatBlock($errorMsg, 'error')
        );

        $this->getOutput()->writeln($msg);
    }
749347
public static function log(Exception $e)
    {
        Base::getLog()->error($e->getMessage(), [
            'code' => $e->getCode(),
            'file' => $e->getFile(),
            'line' => $e->getLine(),
        ]);
    }
779521
public function onEventError(Exception $e)
    {
        if(($this->xErrorCallback))
        {
            call_user_func_array($this->xErrorCallback, array($this->xResponse, $e));
        }
        else
        {
            throw $e;
        }
        return $this->xResponse;
    }
816918
private function logException(\Exception $e)
    {
        if (isset($this->logger)) {
            $this->logger->notice(
                $e->getMessage(), [
                                    'code' => $e->getCode(),
                                    'line' => $e->getLine(),
                                    'file' => $e->getFile(),
                                ]
            );
        } else {
            // @codeCoverageIgnoreStart
            error_log(sprintf('[%s] [%s:%d] %s', $e->getCode(), $e->getFile(), $e->getLine(), $e->getMessage()), E_NOTICE);
            // @codeCoverageIgnoreEnd
        }
    }
887984
public function getErrorResponse(Exception $e, ErrorBag $errorBag)
    {
        if (config('app.debug')) {
            throw $e;
        }

        return parent::getErrorResponse($e, $errorBag);
    }
1169916
protected function processException(Exception $e)
    {
        $this->_lastRenderError = $e;

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

        return '';
    }
335505
protected function renderException($output, \Exception $e)
    {
        $this->app[ExceptionHandler::class]->renderForConsole($output, $e);
    }
819987
protected function formatException(\Exception $e)
	{
		if ($this->debug)
		{
			$location = $e->getMessage().' in '.$e->getFile().':'.$e->getLine();

			return 'Error in exception handler: '.$location;
		}

		return 'Error in exception handler.';
	}
1078313
public function exceptionHandler($e) : void
    {
        $this->setError(
            (int) $e->getCode(),
            (string) $e->getMessage(),
            (string) $e->getFile(),
            (int) $e->getLine(),
            (string) get_class($e),
            $e->getTrace()
        );

        View::render('500.php', (object) $this->errors);
    }
808666
protected function manageException(OutputInterface $output, Exception $e)
    {
        $handler = $this->getExceptionHandler();

        $handler->report($e);

        $handler->renderForConsole($output, $e);
    }
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));
        }
    }
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) {
            }
        }
    }
1047008
protected function error(\Exception $e)
    {
        $str  = sprintf("Message: %s\r\n", $e->getMessage());
        $str .= sprintf("Code: %s\r\n", $e->getCode());
        $str .= sprintf("File: %s (line: %s)\r\n", $e->getFile(), $e->getLine());
        $str .= sprintf("Trade: %s\r\n", $e->getTraceAsString());

        if ($this->log instanceof \Closure)
        {
            $log = $this->log;
            $log($str);
        }
    }
363573
public function getMessage($index)
    {
        if (!$this->hasMessage($index)) {
            throw new \Exception('Message not found : ' . $index);
        }

        return $this->messages[$index];
    }