Generate a full message from response error request

@private
@param object $error

@return string
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;
    }
588442
public function errors($errors) {
        $html = '';
        foreach ($errors as $error) {
            $html .= $this->output->notification($error);
        }
        return $html;
    }
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;
	}
1094438
private static function generateErrorMessage(
        int $responseCode,
        array $allMessage,
        string $responseId
    ): string {
        $lineResponseCode = sprintf(self::FORMAT_RESPONSE_CODE_LINE, $responseCode);
        $lineResponseId = sprintf(self::FORMAT_RESPONSE_ID, $responseId);
        $lineErrorMessage = sprintf(
            self::FORMAT_ERROR_MESSAGE_LINE,
            implode($allMessage)
        );

        return static::glueAllMessage([$lineResponseCode, $lineResponseId, $lineErrorMessage]);
    }
258187
private function error_to_response( $error ) {
		$error_data = $error->get_error_data();
		if ( is_array( $error_data ) && isset( $error_data['status'] ) ) {
			$status = $error_data['status'];
		} else {
			$status = 500;
		}

		$errors = [];
		foreach ( (array) $error->errors as $code => $messages ) {
			foreach ( (array) $messages as $message ) {
				$errors[] = [ 'code' => $code, 'message' => $message, 'data' => $error->get_error_data( $code ) ];
			}
		}

		$data = $errors[0];
		if ( count( $errors ) > 1 ) {
			array_shift( $errors );
			$data['additional_errors'] = $errors;
		}
		$response = new \WP_REST_Response( $data, $status );

		return $response;
	}
560360
protected function renderXmlErrorMessage(Throwable $error)
    {
        $xml = "<error>\n  <message>Slim Application Error</message>\n";
        if ($this->displayErrorDetails) {
            do {
                $xml .= "  <error>\n";
                $xml .= "    <type>" . get_class($error) . "</type>\n";
                $xml .= "    <code>" . $error->getCode() . "</code>\n";
                $xml .= "    <message>" . $this->createCdataSection($error->getMessage()) . "</message>\n";
                $xml .= "    <file>" . $error->getFile() . "</file>\n";
                $xml .= "    <line>" . $error->getLine() . "</line>\n";
                $xml .= "    <trace>" . $this->createCdataSection($error->getTraceAsString()) . "</trace>\n";
                $xml .= "  </error>\n";
            } while ($error = $error->getPrevious());
        }
        $xml .= "</error>";

        return $xml;
    }
802749
protected function buildErrorResponse($error, $code = null)
    {
        if ($code !== null && (!is_int($code) || $code < 400)) {
            $code = null;
        }
        if (is_object($error)) {
            if ($error instanceof AccessDeniedException) {
                $error = $error->getMessage();
                if ($code === null) {
                    $code = Response::HTTP_UNAUTHORIZED;
                }
            } elseif ($error instanceof UserMessageException) {
                if ($error->getCode() >= 400) {
                    $code = $error->getCode();
                }
                $error = $error->getMessage();
            } elseif ($error instanceof Exception || $error instanceof Throwable) {
                $error = t('An unexpected error occurred');
            } elseif (is_callable([$error, '__toString'])) {
                $error = (string) $error;
            } else {
                $error = get_class($error);
            }
        }
        if ($code === null) {
            $code = Response::HTTP_INTERNAL_SERVER_ERROR;
        }

        return $this->getResponseFactory()->create(
            $error,
            $code,
            [
                'Content-Type' => 'text/plain; charset=UTF-8',
            ]
        );
    }
1288738
public static function getString($error)
    {
        if (!is_int($error)) {
            throw new \BadMethodCallException("Invalid type, expected integer, got {$error}.");
        }

        switch ($error) {
            case PREG_NO_ERROR: return 'PREG_NO_ERROR';
            case PREG_INTERNAL_ERROR: return 'PREG_INTERNAL_ERROR';
            case PREG_BACKTRACK_LIMIT_ERROR: return 'PREG_BACKTRACK_LIMIT_ERROR';
            case PREG_BAD_UTF8_ERROR: return 'PREG_BAD_UTF8_ERROR';
            case PREG_RECURSION_LIMIT_ERROR: return 'PREG_RECURSION_LIMIT_ERROR';
            case PREG_BAD_UTF8_OFFSET_ERROR: return 'PREG_BAD_UTF8_OFFSET_ERROR';
            default:
                throw new \BadMethodCallException("Tried to convert unknown PREG error {$error} to string");
        }
    }
490014
function generateReturnableError(error) {
    if (_.isError(error)) {
        return {
            body: {error: error.message},
            options: {code: httpCodes.INTERNAL_SERVER_ERROR}
        };
    }
    if (_.isString(error)) {
        return {
            body: {error},
            options: {code: httpCodes.INTERNAL_SERVER_ERROR}
        };
    }
    if (_.isObject(error) && !_.isFunction(error)) {
        if (_.isArray(error)) {
            return {
                body: {error},
                options: {code: httpCodes.INTERNAL_SERVER_ERROR}
            };
        }
        let code = error.code || httpCodes.INTERNAL_SERVER_ERROR;
        delete error.code;
        return {
            body: error,
            options: {code}
        };
    }
    if (_.isFunction(error)) {
        return {
            body: {error: 'Incorrect error type "function"'},
            options: {code: httpCodes.INTERNAL_SERVER_ERROR}
        };
    }
    return {
        body: {error: 'Unexpected error format'},
        options: {code: httpCodes.INTERNAL_SERVER_ERROR}
    };
}
757632
private function returnValidationErrorResponse($e)
    {
        return $this->response->error($e->getCode(), $e->getMessage(), ['error' => ['errors' => $e->getErrors()]]);
    }
180355
public function response(array $errors)
    {
        $messages = implode(' ', array_flatten($errors));

        return Response::json(ResponseUtil::makeError($messages), 400);
    }
79746
private static function extractErrorDescription($exception)
    {
        $json = Client::responseToArray(
            $exception->getResponse()
        );
        if (isset($json['error_description'])) {
            return $json['error_description'];
        } elseif (isset($json['message'])) {
            return $json['message'];
        } else {
            return null;
        }
    }
902219
private function sendAjaxResponse($error)
    {
        $message = [
            'err' => $error
        ];

        $this->getResponse()
            ->setHeader('Content-type', 'application/javascript', true)
            ->setBody(
                'signupCallback(' . $this->jsonHelper->jsonEncode($message) . ')'
            )
            ->sendResponse();
    }
223788
private function getExceptionClass($error)
    {
        $errors = [
            'PAUSED' => QueuePausedResponseException::class
        ];
        $exceptionClass = ResponseException::class;
        list($errorCode) = explode(" ", $error);
        if (!empty($errorCode) && isset($errors[$errorCode])) {
            $exceptionClass = $errors[$errorCode];
        }
        return $exceptionClass;
    }
119090
private function getMessage(ErrorInterface $error): string
    {
        $message = $this->formatMessage($error->getMessageTemplate(), $error->getMessageParameters());

        return $message;
    }
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;
            }
        }
    }
121933
private function Error ($error)
	{
		
		// Development Mode
		
		if ($this->dev)
		{
			
			// Add to log
			
			$this->log[]	= 'Error: ' . $error;
			
		}
		
		// Add an error to the errrors array
		
		$this->errors[]	= $error;
		
	}