AppserverIo\Appserver\ServletEngine\Utils\ErrorUtil::mapErrorCode PHP Method

mapErrorCode() public method

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
return string The human readable error representation
    public function mapErrorCode(ErrorInterface $error)
    {
        // initialize the error representation
        $wrapped = 'Unknown';
        // query the error type
        switch ($error->getType()) {
            case E_EXCEPTION:
                $wrapped = 'Exception';
                break;
            case E_PARSE:
            case E_ERROR:
            case E_CORE_ERROR:
            case E_COMPILE_ERROR:
            case E_USER_ERROR:
                $wrapped = 'Fatal Error';
                break;
            case E_WARNING:
            case E_USER_WARNING:
            case E_COMPILE_WARNING:
            case E_RECOVERABLE_ERROR:
                $wrapped = 'Warning';
                break;
            case E_NOTICE:
            case E_USER_NOTICE:
                $wrapped = 'Notice';
                break;
            case E_STRICT:
                $wrapped = 'Strict';
                break;
            case E_DEPRECATED:
            case E_USER_DEPRECATED:
                $wrapped = 'Deprecated';
                break;
            default:
                break;
        }
        // return the human readable error representation
        return $wrapped;
    }