yii\base\ErrorHandler::handleFallbackExceptionMessage PHP Method

handleFallbackExceptionMessage() protected method

Handles exception thrown during exception processing in ErrorHandler::handleException.
Since: 2.0.11
protected handleFallbackExceptionMessage ( Exception | Throwable $exception, Exception $previousException )
$exception Exception | Throwable Exception that was thrown during main exception processing.
$previousException Exception Main exception processed in [[handleException()]].
    protected function handleFallbackExceptionMessage($exception, $previousException)
    {
        $msg = "An Error occurred while handling another error:\n";
        $msg .= (string) $exception;
        $msg .= "\nPrevious exception:\n";
        $msg .= (string) $previousException;
        if (YII_DEBUG) {
            if (PHP_SAPI === 'cli') {
                echo $msg . "\n";
            } else {
                echo '<pre>' . htmlspecialchars($msg, ENT_QUOTES, Yii::$app->charset) . '</pre>';
            }
        } else {
            echo 'An internal server error occurred.';
        }
        $msg .= "\n\$_SERVER = " . VarDumper::export($_SERVER);
        error_log($msg);
        if (defined('HHVM_VERSION')) {
            flush();
        }
        exit(1);
    }