PHP 클래스 AppserverIo\Appserver\ServletEngine\Utils\ErrorUtil

파일 보기 프로젝트 열기: appserver-io/appserver 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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