Decides what exception infos should be rendered.

@param \Throwable $t
198310
private function dispatchException(\Throwable $t) {
		array_unshift($this->dispatchingThrowables, $t);
		$numDispatchingThrowables = sizeof($this->dispatchingThrowables);
		
		if (!N2N::isInitialized() || 2 < $numDispatchingThrowables || (2 == $numDispatchingThrowables 
				&& !($this->dispatchingThrowables[1] instanceof StatusException)) || !$this->stable) {
			if (!isset($_SERVER['HTTP_HOST'])) {
				$this->renderExceptionConsoleInfo($t);
				return;
			}
			
			$this->renderFatalExceptionsHtmlInfo($this->dispatchingThrowables);
			return;
		}
		
		if (!N2N::isHttpContextAvailable()) {
			$this->renderExceptionConsoleInfo($t);
			return;
		}

		try {
			$this->renderBeautifulExceptionView($t);
		} catch (\Throwable $t) {
			$this->handleThrowable($t);
		}
	}
1214070
private function toOutput(\Throwable $t) {
    //Write to output
    $renderer = new \Nuki\Handlers\Http\Output\Renderers\RawRenderer();
    $response = new \Nuki\Handlers\Http\Output\Response($renderer);

    $content = get_class($t) . ': ';
    $content .= $t->getMessage();
    $content .= ' in ';
    $content .= $t->getFile() . ':' . $t->getLine();

    $renderer->setContent(new \Nuki\Models\IO\Output\Content($content));

    $response->httpStatusCode(\Nuki\Models\IO\Output\Http::HTTP_EXPECTATION_FAILED);

    $response->send();

    return;
  }
521868
public static void handle(Throwable t) {
		if (logger.isDebugEnabled()) {
			t.printStackTrace();
		}
		JKExceptionUtil.handle(t);
	}
1034523
public function reject(Exception $exception): void
    {
        $this->exception = $exception;
        $this->state = Promise::REJECTED;

        while (count($this->onRejected) > 0) {
            $callback = array_shift($this->onRejected);
            try {
                $exception = call_user_func($callback, $this->exception);
                $this->exception = $exception;
            } catch (Exception $exception) {
                $this->exception = $exception;
            }
        }
    }
168640
public function renderException(\Exception $exception)
    {
        $verbose = $this->console ? $this->console->get('verbose', 0) : 0;

        if (!$verbose) {
            $this->out()->err($exception->getMessage());

            return;
        }

        /** @var $exception \Exception */
        $class = get_class($exception);

        // @codingStandardsIgnoreStart
        $output = <<<EOF
<error>Exception '{$class}' with message:</error> <fg=cyan;options=bold>{$exception->getMessage()}</fg=cyan;options=bold>
<info>in {$exception->getFile()}:{$exception->getLine()}</info>

<error>Stack trace:</error>
{$exception->getTraceAsString()}
EOF;
        // @codingStandardsIgnoreEnd

        $this->out('');
        $this->err($output);
    }
931581
public function handler(Throwable $exception): void
	{
		try
		{
			// Empty output buffers

			$this->clearOutputBuffers();

			// Loop through the exception handlers

			foreach($this->handlers as $handler)
			{
				if($exception instanceof $handler['exceptionType'])
				{
					if($this->handleException($handler['handler'], $exception) !== null)
					{
						break;
					}
				}
			}

			// Log exception

			if($this->shouldExceptionBeLogged($exception))
			{
				$this->getLogger()->error($exception->getMessage(), ['exception' => $exception]);
			}
		}
		catch(Throwable $e)
		{
			// Empty output buffers

			$this->clearOutputBuffers();

			// One of the exception handlers failed so we'll just show the user a generic error screen

			echo $e->getMessage() . ' on line [ ' . $e->getLine() . ' ] in [ ' . $e->getFile() . ' ]' . PHP_EOL;
		}

		exit(1);
	}
1193765
protected function _reportException($exception)
    {
        $msg = '`' . get_class($exception) .'` Code(' . $exception->getCode() . ') with ';
        $message = $exception->getMessage();
        if ($message) {
            $msg .= 'message '. Text::dump($exception->getMessage());
        } else {
            $msg .= 'no message';
        }
        $this->write("{$msg}\n\n");
    }
1247108
public function catchException($exception)
    {
        if (in_array(get_class($exception), $this->config->getExcludeExceptions())) {
            return;
        }

        try {
            $this->send(
                Formatter::make($exception, $this->config)->toArray()
            );
        } catch (Exception $exception) {
            error_log('AfterBug Error: Couldn\'t notify. '.$exception->getMessage());
        }
    }
1184242
public static function display( Exception $e )
	{
		$view	= UI_HTML_Exception_View::render( $e );
		print( self::wrapExceptionView( $view ) );
	}
1008924
protected function handleUncaughtException($e)
    {
        $handler = $this->make('Illuminate\Contracts\Debug\ExceptionHandler');
        
        $handler->report($e);
        
        $handler->render($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));
        }
    }
983710
public function handleException($exception)
    {
        $isHandled = false;
        try {
            $isHandled = $this->handler->handle($exception);
        } catch (Exception $ex) {
        } catch (Throwable $ex) {
        }

        // Bomb out if handler returns true, since was able to render something to the client
        if ($isHandled) {
            exit;
        }

        // Rethrow to be handled by default php exception handling.
        throw $exception;
    }
584665
public function exceptionHandler($exception) {
		try {
			// load errorhandler
			$debug = Factory::load('Debug');
			$debug->errorhandler($exception);
		} catch (\Exception $e) {
			echo "<pre>$exception</pre>\n\n";

			// useful if the \Exception handler itself contains errors
			echo "<pre>The Debug class threw an exception:\n$e</pre>";
		}
	}
131375
protected function renderException($output, \Exception $e)
    {
        $this->laravel[ExceptionHandler::class]->renderForConsole($output, $e);
    }
509331
protected function writeToErrorLog($throwable)
    {
        if ($this->displayErrorDetails()) {
            return;
        }

        $prev = $this->translator()->translate('Previous error:', [], 'charcoal');
        $note = $this->translator()->translate(
            'View in rendered output by enabling the "displayErrorDetails" setting.',
            [],
            'charcoal'
        );

        $message = $this->renderThrowableAsText($throwable);
        while ($throwable = $throwable->getPrevious()) {
            $message .= PHP_EOL.$prev.PHP_EOL;
            $message .= $this->renderThrowableAsText($throwable);
        }

        $message .= PHP_EOL.$note.PHP_EOL;

        $this->logError($message);
    }
925908
static function render(\Throwable $exception, bool $renderTrace = true, bool $renderPrevious = false): string
    {
        $exceptions = $renderPrevious ? static::getChain($exception) : [$exception];
        $totalExceptions = count($exceptions);
        $lastException = $totalExceptions - 1;

        $output = '';
        for ($i = 0; $i < $totalExceptions; ++$i) {
            if ($i > 0 && $renderTrace) {
                $output .= "\n";
            }

            $output .= ($renderPrevious ? '[' . ($i + 1) . "/{$totalExceptions}] " : '')
                . static::getName($exceptions[$i])
                . ': ' . ($exceptions[$i]->getMessage() ?: '<no message>')
                . " in {$exceptions[$i]->getFile()} on line {$exceptions[$i]->getLine()}";

            if ($renderTrace || $i < $lastException) {
                $output .= "\n";
            }

            if ($renderTrace) {
                $output .= $exceptions[$i]->getTraceAsString();

                if ($i < $lastException) {
                    $output .= "\n";
                }
            }
        }

        return $output;
    }
1151962
public static void throwIfUnchecked(Throwable t) {
    Preconditions.checkNotNull(t);
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    }
    if (t instanceof Error) {
      throw (Error) t;
    }
  }