ConsoleExceptionRenderer
in package
Plain text exception rendering with a stack trace.
Useful in CI or plain text environments.
Tags
Table of Contents
Properties
- $error : Throwable
- $output : ConsoleOutput
- $trace : bool
Methods
- __construct() : mixed
- Constructor.
- render() : ResponseInterface|string
- Render an exception into a plain text message.
- write() : void
- Write output to the output stream
- renderException() : array<string|int, mixed>
- Render an individual exception
Properties
$error
private
Throwable
$error
$output
private
ConsoleOutput
$output
$trace
private
bool
$trace
Methods
__construct()
Constructor.
public
__construct(Throwable $error, ServerRequestInterface|null $request, array<string|int, mixed> $config) : mixed
Parameters
- $error : Throwable
-
The error to render.
- $request : ServerRequestInterface|null
-
Not used.
- $config : array<string|int, mixed>
-
Error handling configuration.
render()
Render an exception into a plain text message.
public
render() : ResponseInterface|string
Return values
ResponseInterface|stringwrite()
Write output to the output stream
public
write(string $output) : void
Parameters
- $output : string
-
The output to print.
renderException()
Render an individual exception
protected
renderException(Throwable $exception, int $index) : array<string|int, mixed>
Parameters
- $exception : Throwable
-
The exception to render.
- $index : int
-
Exception index in the chain