PHP Class Zend\Expressive\WhoopsErrorHandler

Extends from TemplatedErrorHandler in order to provide templated error and 404 pages; for exceptions, it delegates to Whoops to provide a user-friendly interface for navigating an exception stack trace.
See also: http://filp.github.io/whoops/
Inheritance: extends TemplatedErrorHandler
Datei anzeigen Open project: zendframework/zend-expressive

Public Methods

Method Description
__construct ( Whoops\Run $whoops, PrettyPageHandler $whoopsHandler = null, Zend\Expressive\Template\TemplateRendererInterface $renderer = null, null | string $template404 = 'error/404', null | string $templateError = 'error/error', Psr\Http\Message\ResponseInterface $originalResponse = null )

Protected Methods

Method Description
handleException ( Throwable $exception, Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : Psr\Http\Message\ResponseInterface Handle an exception.

Private Methods

Method Description
prepareWhoopsHandler ( Psr\Http\Message\RequestInterface $request, PrettyPageHandler $handler ) Prepare the Whoops page handler with a table displaying request information

Method Details

__construct() public method

public __construct ( Whoops\Run $whoops, PrettyPageHandler $whoopsHandler = null, Zend\Expressive\Template\TemplateRendererInterface $renderer = null, null | string $template404 = 'error/404', null | string $templateError = 'error/error', Psr\Http\Message\ResponseInterface $originalResponse = null )
$whoops Whoops\Run
$whoopsHandler Whoops\Handler\PrettyPageHandler
$renderer Zend\Expressive\Template\TemplateRendererInterface
$template404 null | string
$templateError null | string
$originalResponse Psr\Http\Message\ResponseInterface

handleException() protected method

Calls on prepareWhoopsHandler() to inject additional data tables into the generated payload, and then injects the response with the result of whoops handling the exception.
protected handleException ( Throwable $exception, Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : Psr\Http\Message\ResponseInterface
$exception Throwable
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface
return Psr\Http\Message\ResponseInterface