Overview

Namespaces

  • Autarky
    • Config
      • Loaders
    • Console
    • Container
      • Exception
      • Factory
      • Proxy
    • Database
    • Errors
    • Events
    • Files
    • Http
    • Logging
    • Providers
    • Routing
      • Events
    • Testing
    • TwigTemplating
      • Extensions
    • Utils

Classes

  • ErrorHandlerManager
  • ErrorHandlerProvider
  • StubErrorHandler

Interfaces

  • ErrorHandlerInterface
  • ErrorHandlerManagerInterface
  • Overview
  • Namespace
  • Class

Class ErrorHandlerManager

Manager that can handle exceptions as well as keep track of multiple other exception handlers.

Autarky\Errors\ErrorHandlerManager implements Autarky\Errors\ErrorHandlerManagerInterface
Namespace: Autarky\Errors
Located at Errors/ErrorHandlerManager.php
Methods summary
public
# __construct( Autarky\Errors\HandlerResolver $resolver )

Parameters

$resolver
public
# setRethrow( boolean $rethrow )

Set whether exceptions should be handled or rethrown.

Set whether exceptions should be handled or rethrown.

Parameters

$rethrow
$toggle

Implementation of

Autarky\Errors\ErrorHandlerManagerInterface::setRethrow()
public
# appendHandler( callable|Autarky\Errors\ErrorHandlerInterface $handler )

Append a handler to the list of handlers.

Append a handler to the list of handlers.

Parameters

$handler

Implementation of

Autarky\Errors\ErrorHandlerManagerInterface::appendHandler()
public
# prependHandler( callable|Autarky\Errors\ErrorHandlerInterface $handler )

Prepend a handler to the list of handlers.

Prepend a handler to the list of handlers.

Parameters

$handler

Implementation of

Autarky\Errors\ErrorHandlerManagerInterface::prependHandler()
protected
# checkHandler( $handler )
public
# setDefaultHandler( Autarky\Errors\ErrorHandlerInterface $handler )

Set the default handler that will be called if no other handlers are available.

Set the default handler that will be called if no other handlers are available.

Parameters

$handler

Implementation of

Autarky\Errors\ErrorHandlerManagerInterface::setDefaultHandler()
public
# register( )

Register the error handler to handle uncaught exceptions and errors.

Register the error handler to handle uncaught exceptions and errors.

Implementation of

Autarky\Errors\ErrorHandlerManagerInterface::register()
public Symfony\Component\HttpFoundation\Response
# handle( Exception $exception )

Handle an exception.

Handle an exception.

Parameters

$exception

Returns

Symfony\Component\HttpFoundation\Response

Implementation of

Autarky\Errors\ErrorHandlerInterface::handle()
protected Symfony\Component\HttpFoundation\Response
# makeResponse( mixed $response, Exception $exception )

Transform an exception handler's response into a Response object.

Transform an exception handler's response into a Response object.

Parameters

$response
$exception

Returns

Symfony\Component\HttpFoundation\Response
protected boolean
# matchesTypehint( callable|Autarky\Errors\ErrorHandlerInterface $handler, Exception $exception )

Check if a handler's argument typehint matches an exception.

Check if a handler's argument typehint matches an exception.

Parameters

$handler
$exception

Returns

boolean
protected mixed
# callHandler( mixed $handler, Exception $exception )

Call an exception handler.

Call an exception handler.

Parameters

$handler
$exception

Returns

mixed
public Symfony\Component\HttpFoundation\Response
# handleUncaught( Exception $exception )

Handle an uncaught exception. Does the same as handle(), but also sends the response, as we can assume that the exception happened outside of HttpKernelInterface::handle.

Handle an uncaught exception. Does the same as handle(), but also sends the response, as we can assume that the exception happened outside of HttpKernelInterface::handle.

Parameters

$exception

Returns

Symfony\Component\HttpFoundation\Response

Throws

Exception
If PHP_SAPI is 'cli'
public
# handleError( integer $level, string $message, string $file = '', integer $line = 0, array $context = array() )

Handle a PHP error.

Handle a PHP error.

Parameters

$level
$message
$file
$line
$context

Throws

ErrorException
if the error level matches PHP's error reporting.
public
# handleShutdown( )

Handle a PHP fatal error.

Handle a PHP fatal error.

public
# throwFatalErrorException( )

Throw a FatalErrorException if an error has occured.

Throw a FatalErrorException if an error has occured.

Throws

Symfony\Component\Debug\Exception\FatalErrorException
protected Symfony\Component\Debug\Exception\FatalErrorException|null
# makeFatalErrorException( )

Create a FatalErrorException out of the information stored on the last PHP error.

Create a FatalErrorException out of the information stored on the last PHP error.

Returns

Symfony\Component\Debug\Exception\FatalErrorException|null
Properties summary
protected Autarky\Errors\HandlerResolver $resolver
#
protected SplDoublyLinkedList $handlers
#
protected Autarky\Errors\ErrorHandlerInterface|null $defaultHandler
#
protected boolean $rethrow

Re-throw exceptions rather than handling them.

Re-throw exceptions rather than handling them.

# false
Autarky Framework API documentation generated by ApiGen