Search::Elasticsearch::Error(3pm) User Contributed Perl Documentation Search::Elasticsearch::Error(3pm)

Search::Elasticsearch::Error - Errors thrown by Search::Elasticsearch

version 8.12

Errors thrown by Search::Elasticsearch are error objects, which can include a stack trace and information to help debug problems. An error object consists of the following:

    {
        type  => $type,              # eg Missing
        text  => 'Error message',
        vars  => {...},              # vars which may help to explain the error
        stack => [...],              # a stack trace
    }

The $Search::Elasticsearch::Error::DEBUG variable can be set to 1 or 2 to increase the verbosity of errors.

Error objects stringify to a human readable error message when used in text context (for example: "print 'Oh no! '.$error"). They also support the "TO_JSON" method to support conversion to JSON when "convert_blessed" in JSON is enabled.

The following error classes are defined:

  • "Search::Elasticsearch::Error::Unauthorized"

    Invalid (or no) username/password provided as "userinfo" for a password protected service. These errors are triggered by the 401 HTTP status code.

  • "Search::Elasticsearch::Error::Missing"

    A resource that you requested was not found. These errors are triggered by the 404 HTTP status code.

  • "Elastisearch::Error::Conflict"

    Your request could not be performed because of some conflict. For instance, if you try to delete a document with a particular version number, and the document has already changed, it will throw a "Conflict" error. If it can, it will include the "current_version" in the error vars. This error is triggered by the 409 HTTP status code.

  • "Search::Elasticsearch::Error::ContentLength"

    The request body was longer than the max_content_length.

  • "Search::Elasticsearch::Error::RequestTimeout"

    The request took longer than the specified "timeout". Currently only applies to the cluster_health request.

  • "Search::Elasticsearch::Error::Unavailable"

    The current node is unable to handle your request at the moment. Your request will be retried on another node. This error is triggered by the 503 HTTP status code.

  • "Search::Elasticsearch::Error::BadGateway"

    A proxy between the client and Elasticsearch is unable to connect to Elasticsearch. This error is triggered by the 502 HTTP status code.

  • "Search::Elasticsearch::Error::GatewayTimeout"

    A proxy between the client and Elasticsearch is unable to connect to Elasticsearch within its own timeout. This error is triggered by the 504 HTTP status code.

  • "Search::Elasticsearch::Error::SSL"

    There was a problem validating the SSL certificate. Not all backends support this error type.

Enrico Zimuel <enrico.zimuel@elastic.co>

This software is Copyright (c) 2024 by Elasticsearch BV.

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004
2024-02-04 perl v5.38.2