Display error in XML format

@param Exception $exception Exception to show message from
195230
protected function showXML($exception) {
		$endline = "\r\n";
		$xml = '<?xml version="1.0" encoding="UTF-8"?>'.$endline.
				'<response>'.$endline.
					'<status>error</status>'.$endline.
					'<message>'.htmlspecialchars($this->getMessageForUser($exception)).'</message>'.$endline.
				'</response>';

		header('Content-Type: application/xml; charset=utf-8');
		echo $xml;
	}
554604
protected function log(\Exception $exception)
    {
        if (null !== $this->logger) {
            $message = sprintf(
                '%s: %s (uncaught exception) at %s line %s',
                get_class($exception),
                $exception->getMessage(),
                $exception->getFile(),
                $exception->getLine()
            );

            $this->logger->error($message, array('exception' => $exception));
        }
    }
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));
        }
    }
923807
protected function renderHtmlErrorMessage(HttpException $exception)
    {
        $title = $exception->getName();
        $html = '<p>' . $exception->getMessage() . '</p>';

        $output = sprintf(
            "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" .
            "<title>%s</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana," .
            "sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{" .
            "display:inline-block;width:65px;}</style></head><body><h1>%s</h1>%s</body></html>",
            $title,
            $title,
            $html
        );

        return $output;
    }
1260024
public function exceptionHandler(Exception $exception)
    {
        $this->logger->addError($exception->getMessage(), array($exception->getFile(), $exception->getLine()));
        exit(-1);
    }
756827
protected function renderJsonErrorMessage(Exception $exception)
    {
        $error = [
            'message' => 'Slim Application Error',
        ];

        if ($this->displayErrorDetails) {
            $error['exception'] = [];

            do {
                $error['exception'][] = [
                    'type' => get_class($exception),
                    'code' => $exception->getCode(),
                    'message' => $exception->getMessage(),
                    'file' => $exception->getFile(),
                    'line' => $exception->getLine(),
                    'trace' => explode("\n", $exception->getTraceAsString()),
                ];
            } while ($exception = $exception->getPrevious());
        }

        return json_encode($error, JSON_PRETTY_PRINT);
    }
819664
protected function format_exception( Exception $exception ) {
		$string = get_class( $exception );

		if ( ! empty( $exception->getMessage() ) ) {
			$string .= " : {$exception->getMessage()}";
		}

		if ( ! empty( $exception->getCode() ) ) {
			$string .= " (#{$exception->getCode()})";
		}

		return $string;
	}
53351
public static function renderException(\Exception $exception)
    {
        $error = new MessageBag([
            'type'    => get_class($exception),
            'message' => $exception->getMessage(),
            'file'    => $exception->getFile(),
            'line'    => $exception->getLine(),
            'trace'   => $exception->getTraceAsString(),
        ]);

        $errors = new ViewErrorBag();
        $errors->put('exception', $error);

        return view('admin::partials.exception', compact('errors'))->render();
    }
1098703
public function handleException(Exception $exception) {
        // untangle message from php7errorexception
        $message = $exception instanceof PHP7ErrorException ? $exception->getError()->getMessage(): $exception->getMessage();

        // send a debug mail with the exception
        if(!$this->debug && !in_array(get_class($exception), $this->_skipExceptions))
            $this->_email('CLI Exception', Misc::dump($exception, $message, true));

        // continue with exception handle logic
        parent::handleException($exception);
    }
436773
public function logError(Exception $exception, $message = '')
    {
        if (empty($message)) {
            $message = $exception->getMessage();
        }

        array_push($this->store, array(
            'data' => $message,
            'file' => $exception->getFile(),
            'line' => $exception->getLine(),
            'type' => 'error'
        ));
    }
612050
public function convertExceptionToHtml($exception)
    {
        $flat = $this->getFlattenedException($exception);

        $handler = new SymfonyExceptionHandler();

        return $this->decorate($handler->getContent($flat), $handler->getStylesheet($flat), $flat);
    }
516105
public function getHTMLError($exception) {
		$html = '<div style="position: absolute; top:0; right:0; width:100%; height:100%; background: #ffffff;">'."\n".
			'<table align="center" style="width:65%; margin-top: 30px; background: #FFCC66;" cellpadding="10" cellspacing="1" border="0">'."\n".
			'<tr>'."\n".
				'<td style="background: #FFCC99;">Unexpected error!</td>'."\n".
			'</tr>'."\n".
			'<tr>'."\n".
				'<td style="padding-top: 15px; padding-bottom: 35px; background: #FFFF99;">'."\n".
					$this->getMessageForUser($exception).'.<br><br>'."\n".
					'We are notified and will solve the problem as soon as possible.<br>'."\n".
				'</td>'."\n".
			'</tr>'."\n";
		
		if ($this->showtrace) {
			$html .= '<tr>'."\n".
					'<td style="padding-top: 15px; padding-bottom: 35px; background: #FFFF99; white-space: pre ;">'."\n".
						$exception->getTraceAsString()."\n".
					'</td>'."\n".
				'</tr>'."\n";
		}

		$html .= '</table>'."\n".
			'</div>';
		return $html;
	}
36542
protected function error(Request $request, \Exception $exception) {
        return $request->getTarget() . ' threw '
        . get_class($exception) . ': '
        . $exception->getMessage() . "\n"
        . $exception->getTraceAsString();
    }
273036
private static function _formatException($exception)
    {
        return str_replace(realpath(BASE_PATH), '', \Mmi\App\FrontController::getInstance()->getEnvironment()->requestUri . ' (' . $exception->getMessage() . ') @' .
            $exception->getFile() . '(' . $exception->getLine() . ') ' .
            self::_formatTrace($exception));
    }
715121
protected function logException(\Exception $exception)
    {
        $this->logger->error(
            $exception->getMessage(),
            array(
                'class'=>get_class($exception),
                'message'=>$exception->getMessage(),
                'file'=>$exception->getMessage(),
                'line'=>$exception->getMessage(),
                'command'=>$this->getName()
            )
        );
    }
1181563
protected function renderHtmlErrorMessage(Exception $exception)
    {
        $title = 'Slim Application Error';

        if ($this->displayErrorDetails) {
            $html = '<p>The application could not run because of the following error:</p>';
            $html .= '<h2>Details</h2>';
            $html .= $this->renderHtmlException($exception);

            while ($exception = $exception->getPrevious()) {
                $html .= '<h2>Previous exception</h2>';
                $html .= $this->renderHtmlExceptionOrError($exception);
            }
        } else {
            $html = '<p>A website error has occurred. Sorry for the temporary inconvenience.</p>';
        }

        $output = sprintf(
            "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" .
            "<title>%s</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana," .
            "sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{" .
            "display:inline-block;width:65px;}</style></head><body><h1>%s</h1>%s</body></html>",
            $title,
            $title,
            $html
        );

        return $output;
    }
1285722
public function PHPExceptionHandler($exception)
    {
        session_write_close();
        $message = $exception->getMessage() . ' | File: {file} | Ln: {line} | ST: {stacktrace}';
        $context = array(
            'file' => $exception->getFile(),
            'line' => $exception->getLine(),
            'stacktrace' => $exception->getTraceAsString()
        );
        $this->logger->log($this->exceptionLogLevel, $message, $context);
    }