Overview
  • Namespace
  • Class

Namespaces

  • Slim
    • Exception
    • Handlers
      • Strategies
    • Http
    • Interfaces
      • Http

Classes

  • AbstractError
  • AbstractHandler
  • Error
  • NotAllowed
  • NotFound
  • PhpError

Class PhpError

Default Slim application error handler for PHP 7+ Throwables

It outputs the error message and diagnostic information in either JSON, XML, or HTML based on the Accept header.

Slim\Handlers\AbstractHandler
Extended by Slim\Handlers\AbstractError
Extended by Slim\Handlers\PhpError
Namespace: Slim\Handlers
Located at Handlers/PhpError.php

Methods summary

public Psr\Http\Message\ResponseInterface
# __invoke( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, Throwable $error )

Invoke error handler

Invoke error handler

Parameters

$request
The most recent Request object
$response
The most recent Response object
$error
The caught Throwable object

Returns

Psr\Http\Message\ResponseInterface

Throws

UnexpectedValueException
protected string
# renderHtmlErrorMessage( Throwable $error )

Render HTML error page

Render HTML error page

Parameters

$error

Returns

string
protected string
# renderHtmlError( Throwable $error )

Render error as HTML.

Render error as HTML.

Parameters

$error

Returns

string
protected string
# renderJsonErrorMessage( Throwable $error )

Render JSON error

Render JSON error

Parameters

$error

Returns

string
protected string
# renderXmlErrorMessage( Throwable $error )

Render XML error

Render XML error

Parameters

$error

Returns

string

Methods inherited from Slim\Handlers\AbstractError

__construct(), logError(), renderThrowableAsText(), writeToErrorLog()

Methods inherited from Slim\Handlers\AbstractHandler

determineContentType()

Properties summary

Properties inherited from Slim\Handlers\AbstractError

$displayErrorDetails, $outputBuffering

Properties inherited from Slim\Handlers\AbstractHandler

$knownContentTypes

API documentation generated by ApiGen