PHP Class AppserverIo\Appserver\ServletEngine\Utils\ErrorUtil

Afficher le fichier Open project: appserver-io/appserver Class Usage Examples

Protected Properties

Свойство Type Description
$instance ErrorUtil The singleton instance.

Méthodes publiques

Méthode Description
fromArray ( array $error ) : AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface Create's a new error instance with the values from the passed array.
fromException ( Exception $e ) : AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface Create's a new error instance from the passed exception.
handleErrors ( RequestHandler $requestHandler, AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest, AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface $servletResponse ) : void This method finally handles all PHP and user errors as well as the exceptions that have been thrown through the servlet processing.
mapErrorCode ( AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface $error ) : string Return's the a human readable error representation for the passed error instance.
mapLogLevel ( AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface $error ) : string Return's the log level for the passed error instance.
prepareMessage ( AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface $error ) : string Prepare's the error message for logging/rendering purposes.
singleton ( ) : ErrorUtil Create's and return's the singleton instance.

Method Details

fromArray() public méthode

Create's a new error instance with the values from the passed array.
public fromArray ( array $error ) : AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface
$error array The array containing the error information
Résultat AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface The error instance

fromException() public méthode

Create's a new error instance from the passed exception.
public fromException ( Exception $e ) : AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface
$e Exception The exception to create the error instance from
Résultat AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface The error instance

handleErrors() public méthode

This method finally handles all PHP and user errors as well as the exceptions that have been thrown through the servlet processing.
public handleErrors ( RequestHandler $requestHandler, AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest, AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface $servletResponse ) : void
$requestHandler AppserverIo\Appserver\ServletEngine\RequestHandler The request handler instance
$servletRequest AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The actual request instance
$servletResponse AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface The actual request instance
Résultat void

mapErrorCode() public méthode

Return's the a human readable error representation for the passed error instance.
public mapErrorCode ( AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface $error ) : string
$error AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface The error instance
Résultat string The human readable error representation

mapLogLevel() public méthode

Return's the log level for the passed error instance.
public mapLogLevel ( AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface $error ) : string
$error AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface The error instance to map the log level for
Résultat string

prepareMessage() public méthode

Prepare's the error message for logging/rendering purposes.
public prepareMessage ( AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface $error ) : string
$error AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface The error instance to create the message from
Résultat string The error message

singleton() public static méthode

Create's and return's the singleton instance.
public static singleton ( ) : ErrorUtil
Résultat ErrorUtil The singleton instance

Property Details

$instance protected_oe static_oe property

The singleton instance.
protected static ErrorUtil,AppserverIo\Appserver\ServletEngine\Utils $instance
Résultat ErrorUtil