Return a human-readable version of a Win32 error code.

@param  int $error

@return string
550621
public static function errorToString($error) {
        if (!is_int($error)) throw new IllegalTypeException('Illegal type of parameter $error: '.gettype($error));

        if (key_exists($error, self::$win32Errors))
            return self::$win32Errors[$error][0];
        return (string) $error;
    }
1178952
private function pluckError(array $error) {
        $row = array_intersect_key(
            $error,
            ['field' => 1, 'error' => 1, 'code' => 1]
        );

        $row['message'] = $this->formatErrorMessage($error);
        return $row;
    }
588442
public function errors($errors) {
        $html = '';
        foreach ($errors as $error) {
            $html .= $this->output->notification($error);
        }
        return $html;
    }
778209
protected function getPregErrorText($code = null)
    {
        $code = $code ?: preg_last_error();

        if (!isset(self::$pregErrors[$code])) {
            $code = PREG_NO_ERROR;
        }

        return self::$pregErrors[$code];
    }
747626
public function error($error) {
		return fwrite($this->error, Text::insert($error, $this->styles()));
	}
81697
public function getErrorMessage($error, $default = NULL)
    {
        $messages = $this->_http_files->getErrorMessages();
        if (isset($messages[$error])) {
            return $messages[$error];
        } else {
            if (is_null($default)) {
                return "Erreur indéfinie !";
            } else {
                return $default;
            }
        }
    }
912273
public static function getMessageByCode(int $code): string
    {
        return (array_key_exists($code, self::MESSAGES)) ? self::MESSAGES[$code] : self::MESSAGES[self::UNKNOWN_ERROR];
    }
127007
public function getFormattedError(array $error, $header = '')
    {
        $output = "<table style='background:#fcf8e3;
                                 color:#8a6d3b;
                                 width:100%;
                                 margin-bottom:10px;
                                 border: 1px solid #faebcc;
                                 border-collapse: collapse;'>";

        if (!empty($header)) {
            $output .= "<tr>
                          <td colspan='2' style='border-bottom: 1px solid #faebcc;'><b>$header</b></td>
                        </tr>\n";
        }

        $output .= "<tr>
                      <td style='background-color: #faebcc;'>Message </td>
                      <td style='border-bottom: 1px solid #faebcc;'>{$error['message']}</td>
                    </tr>\n";

        if (isset($error['code'])) {
            $output .= "<tr>
                          <td style='background-color: #faebcc;'>Code </td>
                          <td style='border-bottom: 1px solid #faebcc;'>{$error['code']}</td>
                       </tr>\n";
        }

        if (isset($error['type'])) {
            $output .= "<tr>
                          <td style='background-color: #faebcc;'>Type </td>
                          <td style='border-bottom: 1px solid #faebcc;'>{$error['type']}</td>
                        </tr>\n";
        }

        $output .= "<tr>
                      <td style='background-color: #faebcc;'>File </td>
                      <td style='border-bottom: 1px solid #faebcc;'>{$error['file']}</td>
                    </tr>
                    <tr>
                      <td style='background-color: #faebcc;'>Line </td>
                      <td style='border-bottom: 1px solid #faebcc;'>{$error['line']}</td>
                    </tr>\n";

        if ($this->print_backtrace && !empty($error['backtrace'])) {
            $error['backtrace'] = implode("<br>\n", $error['backtrace']);
            $output .= "<tr>
                          <td style='background-color: #faebcc;'>Backtrace </td>
                          <td style='border-bottom: 1px solid #faebcc;'>{$error['backtrace']}</td>
                        </tr>\n";
        }

        $output .= '</table>';
        return GC_CLI ? preg_replace("/(\n| )+/", "$1", trim(strip_tags($output))) : $output;
    }
743446
protected function formatLibXmlError(LibXMLError $error)
    {
        return sprintf(
            '%s in %d:%d: %s',
            $this->errorTypes[$error->level],
            $error->line,
            $error->column,
            trim($error->message)
        );
    }
594688
private function tryResolveErrorReason(string $message): string
    {
        $key = $this->responseParser->parse($message);

        if ($key === 'invalid_phone') {
            return ErrorReasons::INVALID_PHONE_NUMBER;
        }

        return ErrorReasons::UNKNOWN;
    }
1080696
public function getErrorsAsString()
    {
        $string = '';
        foreach ($this->getErrors() as $error) {
            $string .= sprintf(
                "%s: %s",
                $error['field'],
                $error['message']
            );
            if (isset($error['rejected'])) {
                $string .= sprintf(" ('%s' given)", $error['rejected']);
            }
            $string .= ";\n";
        }

        return trim($string);
    }
1043083
protected function getErrorMessage(Exception $exception)
    {
        $defaultMessage =  __('Unexpected error. Please contact administrator');
        if (DEBUG_MODE) {
            $defaultMessage = $exception->getMessage();
        }
        return ($exception instanceof common_exception_UserReadableException) ? $exception->getUserMessage() :  $defaultMessage;
    }
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;
    }
818787
public function getErrorMessage(): string
    {
        $header = $this->headers->get('grpc-message');
        return $header ? $header->getFirstValue() : substr($this->body, 0, 255);
    }
119090
private function getMessage(ErrorInterface $error): string
    {
        $message = $this->formatMessage($error->getMessageTemplate(), $error->getMessageParameters());

        return $message;
    }
965996
private function getResponseErrorMessage($error)
    {
        $message = $error->message;

        if (isset($error->details) && is_array($error->details)) {
            foreach ($error->details as $detail) {
                $message .= implode(' - ', $detail->errors).' ['.$detail->error_type.' in '.$detail->parameter.'] ';
            }
        }

        return $message;
    }
552796
public function errorInfo(): string
    {
        if($this->lastStmt)
        {
            return $this->lastStmt->errorInfo();
        }
        else
        {
            $errorInfo = $this->instance->errorInfo();
            return !isset($errorInfo[0]) || 0 == $errorInfo[0] ? '' : implode(' ', $errorInfo);
        }
    }