Return's the a human readable error representation for the passed error instance.

@param \AppserverIo\Appserver\Core\Utilities\ErrorInterface $error The error instance

@return string The human readable error representation
342341
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;
    }
653790
protected function parseResponse(ResponseInterface $response): string
    {
        $data = \GuzzleHttp\json_decode($response->getBody(), true);
        isset($data[0]) ? $this->setNotificationData($data) : $this->setData($data);
        $message = sprintf('HTTP %s Error %s', $response->getStatusCode(), $this->data['title']);
        if (isset($this->data['description'])) {
            $message .= sprintf(': %s', $this->getDescription());
        }

        return $message;
    }
788909
private function getMessage($error, ServerRequestInterface $request, ResponseInterface $response)
    {
        if ($error instanceof ApiException) {
            $message = $error->getArrayMessage();
            return !empty($message) ? $message : $error->getMessage();
        }

        if ($error instanceof \Throwable) {
            return $error;
        }

        return 'An error ocurred.';
    }
747626
public function error($error) {
		return fwrite($this->error, Text::insert($error, $this->styles()));
	}
1311162
private function getStatusCode($error, ResponseInterface $response)
    {
        if ($error instanceof \Throwable && ($error->getCode() >= 400 && $error->getCode() <= 599)) {
            return $error->getCode();
        }

        $status = $response->getStatusCode();
        if (! $status || $status < 400 || $status > 599) {
            $status = 500;
        }
        return $status;
    }
138489
public static function getErrorStr($errors){
		$str = '';
		if(is_array($errors)){
			foreach($errors as $field=>$error_k){
				$str .= $field.':'.implode(",",$error_k)." <br/>";
			}
		}
		return $str;
	}
72368
protected function determineExceptionType(Throwable $exception): string
	{
		if($exception instanceof ErrorException)
		{
			$code = $exception->getCode();

			$codes =
			[
				E_ERROR             => 'Fatal Error',
				E_PARSE             => 'Parse Error',
				E_COMPILE_ERROR     => 'Compile Error',
				E_COMPILE_WARNING   => 'Compile Warning',
				E_STRICT            => 'Strict Mode Error',
				E_NOTICE            => 'Notice',
				E_WARNING           => 'Warning',
				E_RECOVERABLE_ERROR => 'Recoverable Error',
				E_DEPRECATED        => 'Deprecated',
				E_USER_NOTICE       => 'Notice',
				E_USER_WARNING      => 'Warning',
				E_USER_ERROR        => 'Error',
				E_USER_DEPRECATED   => 'Deprecated',
			];

			return in_array($code, array_keys($codes)) ? $codes[$code] : 'ErrorException';
		}

		return get_class($exception);
	}
1025418
protected function formatThrowable($error)
    {
        $message = trim($error->getMessage()) . "\n";
        if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
            $file = $error->getFile();
            if ($file) {
                $message .= "\nFile:\n$file";
                $line = $error->getLine();
                if ($line) {
                    $message .= ':' . $line;
                }
                $message .= "\n";
            }
            if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE) {
                $trace = $error->getTraceAsString();
                if ($trace) {
                    $message .= "\nTrace:\n$trace\n";
                }
            }
        }

        return $message;
    }
1161428
protected static function getMapErrors(ConstraintViolationListInterface $errors)
    {
        $maps = [];
        $size = $errors->count();

        for ($i = 0; $i < $size; ++$i) {
            $root = $errors->get($i)->getRoot();

            if (\is_object($root)) {
                $maps[spl_object_hash($errors->get($i)->getRoot())] = $errors->get($i);
            } else {
                $maps[] = $errors->get($i);
            }
        }

        return $maps;
    }
259805
public function getErrorDefinitionId(ErrorDoc $error, $definitionType) : string
    {
        $base = 'UNKNONWN_ERROR-%s';
        switch ($definitionType) {
            case self::CUSTOM_ERROR_DEFINITION_TYPE:
                $base = 'Error-%s';
                break;
            case self::SERVER_ERROR_DEFINITION_TYPE:
                $base = 'ServerError-%s';
                break;
        }

        return sprintf($base, $error->getIdentifier());
    }
79952
protected function getErrorCallback(ConnectionInterface $connection)
    {
        $logger = $this->getLogger();
        return function($exception) use ($connection, $logger) {
            $this->emit('connect.error', array($exception, $connection, $logger));
        };
    }
8608
public function decorateException($error)
    {
        $application = $this->application;

        if (is_callable($error)) {
            $error = $application->getContainer()->call($error, [$application]);
        }

        if (is_object($error) && !($error instanceof \Exception)) {
            $error = method_exists($error,
                '__toString') ? $error->__toString() : 'Error with object ' . get_class($error);
        }

        if (is_resource($error)) {
            $error = 'Error with resource type ' . get_resource_type($error);
        }

        if (is_array($error)) {
            $error = implode("\n", $error);
        }

        if (!($error instanceof \Exception)) {
            $error = new \Exception(is_scalar($error) ? $error : 'Error with ' . gettype($error));
        }

        return $error;
    }
986972
protected function renderHtmlError(Throwable $error)
    {
        $html = sprintf('<div><strong>Type:</strong> %s</div>', get_class($error));

        if (($code = $error->getCode())) {
            $html .= sprintf('<div><strong>Code:</strong> %s</div>', $code);
        }

        if (($message = $error->getMessage())) {
            $html .= sprintf('<div><strong>Message:</strong> %s</div>', htmlentities($message));
        }

        if (($file = $error->getFile())) {
            $html .= sprintf('<div><strong>File:</strong> %s</div>', $file);
        }

        if (($line = $error->getLine())) {
            $html .= sprintf('<div><strong>Line:</strong> %s</div>', $line);
        }

        if (($trace = $error->getTraceAsString())) {
            $html .= '<h2>Trace</h2>';
            $html .= sprintf('<pre>%s</pre>', htmlentities($trace));
        }

        return $html;
    }
371606
protected function writeError(OutputInterface $output, $error)
    {
        $result = [trim($error->getMessage())];

        // If the output is verbose, add file and location
        if ($output->isVerbose()) {
            $file = $error->getFile();
            if ($file) {
                $result[] = "File: {$file}" . ($error->getLine() ? ':' . $error->getLine() : '');
            }
        }

        // If the output is very verbose, add stacktrace
        if ($output->isVeryVerbose()) {
            $trace = $error->getTraceAsString();
            $result[] = 'Trace:';
            $result[] = $trace;
        }

        $this->output->error($result);
    }
1045387
private function withError(ResponseInterface $response, $throwable)
    {
        if ($throwable instanceof ErrorException) {
            $severity = ErrorHandler::getErrorType($throwable->getSeverity());
        } else {
            $severity = 'Error';
        }

        $contents = [
            'message' => 'Application Error',
            'status' => 500,
            'severity' => $severity,
            'throwable' => $throwable,
        ];

        if ($this->displayErrorDetails) {
            $throwables = $this->unpackThrowables($throwable);
            $contents['details'] = $this->formatStacktraceForExceptions($throwables);
            $contents['message'] = $throwable->getMessage();
        }

        return $this
            ->withHTML($response, $contents)
            ->withStatus(500);
    }
596184
public function getErrorText()
    {
        $message = '';
        if ($this->isError()) {
            $message = $this->messages->message[0]->text;
            if (@$this->transactionResponse->errors[0]->errorText) {
                $message = $this->transactionResponse->errors[0]->errorText;
            }
        }
        return $message;
    }
586602
protected function logError($error)
    {
        $code = $error instanceof \ErrorException ? $error->getSeverity() : E_ERROR;
        $level = $this->getLogLevel($code);
        
        $message = sprintf('%s: %s at %s line %s', $this->codeToString($code), $error->getMessage(),
            $error->getFile(), $error->getLine());

        $context = [
            'error' => $error,
            'code' => $code,
            'message' => $error->getMessage(),
            'file' => $error->getFile(),
            'line' => $error->getLine()
        ];

        $this->getLogger()->log($level, $message, $context);
    }