Overview

Namespaces

  • Charcoal
    • App
      • Action
      • Config
      • Handler
      • Middleware
      • Module
      • Route
      • Script
      • ServiceProvider
      • Template

Classes

  • AbstractHandler
  • Error
  • HandlerConfig
  • NotAllowed
  • NotFound
  • PhpError
  • Shutdown

Interfaces

  • HandlerInterface
  • Overview
  • Namespace
  • Class

Class Error

Error Handler

Enhanced version of \Slim\Handlers\NotFound.

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

Charcoal\App\Handler\AbstractHandler implements Charcoal\Config\ConfigurableInterface, Charcoal\App\Handler\HandlerInterface, Psr\Log\LoggerAwareInterface, Charcoal\View\ViewableInterface uses Charcoal\Config\ConfigurableTrait (not available) Psr\Log\LoggerAwareTrait (not available) Charcoal\Translator\TranslatorAwareTrait (not available) Charcoal\View\ViewableTrait (not available)
Extended by Charcoal\App\Handler\Error
Namespace: Charcoal\App\Handler
Located at Charcoal/App/Handler/Error.php
Methods summary
public Charcoal\App\Handler\Error
# setDependencies( Pimple\Container $container )

Inject dependencies from a Pimple Container.

Inject dependencies from a Pimple Container.

Dependencies

  • array $settings — Slim's settings.

Parameters

$container
A dependencies container instance.

Returns

Charcoal\App\Handler\Error
Chainable

Overrides

Charcoal\App\Handler\AbstractHandler::setDependencies()
public Psr\Http\Message\ResponseInterface
# __invoke( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, Exception $error )

Invoke Error Handler

Invoke Error Handler

Parameters

$request
The most recent Request object.
$response
The most recent Response object.
$error
The caught Exception object.

Returns

Psr\Http\Message\ResponseInterface
protected Charcoal\App\Handler\Error
# setDisplayErrorDetails( boolean $state )

Set whether to display details of the error or a generic message.

Set whether to display details of the error or a generic message.

Parameters

$state
Whether to display error details.

Returns

Charcoal\App\Handler\Error
Chainable
public boolean
# displayErrorDetails( )

Retrieves the HTTP methods allowed by the current request.

Retrieves the HTTP methods allowed by the current request.

Returns

boolean
protected Charcoal\App\Handler\Error
# setException( Exception $error )

Set the caught error.

Set the caught error.

Parameters

$error
The caught Exception object.

Returns

Charcoal\App\Handler\Error
Chainable
public Exception
# exception( )

Retrieves the caught error.

Retrieves the caught error.

Returns

Exception
protected
# writeToErrorLog( )

Write to the error log if displayErrorDetails is false

Write to the error log if displayErrorDetails is false

protected string
# renderTextError( Exception $error )

Render error as Text.

Render error as Text.

Parameters

$error
The caught Exception object.

Returns

string
protected string
# renderJsonOutput( )

Render JSON Error

Render JSON Error

Returns

string
protected string
# renderXmlOutput( )

Render XML Error

Render XML Error

Returns

string
protected string
# renderHtmlError( Exception $error )

Render error as HTML.

Render error as HTML.

Parameters

$error
The caught Exception object.

Returns

string
public string
# renderHtmlMessage( )

Render body of HTML error

Render body of HTML error

Returns

string
Methods inherited from Charcoal\App\Handler\AbstractHandler
__construct(), baseUrl(), createConfig(), determineContentType(), init(), messageTitle(), renderHtmlOutput(), renderHtmlTemplate(), setBaseUrl(), setContainer()
Properties summary
protected boolean $displayErrorDetails

Whether to output the error's details.

Whether to output the error's details.

#
protected Exception $exception

The caught exception.

The caught exception.

#
Properties inherited from Charcoal\App\Handler\AbstractHandler
$baseUrl, $container, $knownContentTypes
API documentation generated by ApiGen