PHP Класс AppserverIo\Appserver\ServletEngine\Utils\ErrorUtil

Автор: Tim Wagner ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$instance ErrorUtil The singleton instance.

Открытые методы

Метод Описание
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.

Описание методов

fromArray() публичный Метод

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
Результат AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface The error instance

fromException() публичный Метод

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
Результат AppserverIo\Appserver\ServletEngine\Utils\ErrorInterface The error instance

handleErrors() публичный Метод

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
Результат void

mapErrorCode() публичный Метод

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
Результат string The human readable error representation

mapLogLevel() публичный Метод

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
Результат string

prepareMessage() публичный Метод

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
Результат string The error message

singleton() публичный статический Метод

Create's and return's the singleton instance.
public static singleton ( ) : ErrorUtil
Результат ErrorUtil The singleton instance

Описание свойств

$instance защищенное статическое свойство

The singleton instance.
protected static ErrorUtil,AppserverIo\Appserver\ServletEngine\Utils $instance
Результат ErrorUtil