SerializerErrorRenderer
in package
implements
ErrorRendererInterface
Formats an exception using Serializer for rendering.
Tags
Interfaces, Classes and Traits
- ErrorRendererInterface
- Formats an exception to be used as response content.
Table of Contents
- $debug : mixed
- $fallbackErrorRenderer : mixed
- $format : mixed
- $serializer : mixed
- __construct() : mixed
- getPreferredFormat() : Closure
- render() : FlattenException
- Renders a Throwable as a FlattenException.
Properties
$debug
private
mixed
$debug
$fallbackErrorRenderer
private
mixed
$fallbackErrorRenderer
$format
private
mixed
$format
$serializer
private
mixed
$serializer
Methods
__construct()
public
__construct(SerializerInterface $serializer, string|callable $format[, ErrorRendererInterface|null $fallbackErrorRenderer = null ][, bool|callable $debug = false ]) : mixed
Parameters
- $serializer : SerializerInterface
- $format : string|callable
-
The format as a string or a callable that should return it formats not supported by Request::getMimeTypes() should be given as mime types
- $fallbackErrorRenderer : ErrorRendererInterface|null = null
- $debug : bool|callable = false
-
The debugging mode as a boolean or a callable that should return it
Return values
mixed —getPreferredFormat()
public
static getPreferredFormat(RequestStack $requestStack) : Closure
Parameters
- $requestStack : RequestStack
Return values
Closure —render()
Renders a Throwable as a FlattenException.
public
render(Throwable $exception) : FlattenException
Parameters
- $exception : Throwable