Class ElasticsearchGetByIdException
- Namespace
- Excalibur.Data.ElasticSearch.Exceptions
- Assembly
- Excalibur.Data.ElasticSearch.dll
Represents an exception thrown when an attempt to retrieve a document by ID from Elasticsearch fails.
public sealed class ElasticsearchGetByIdException : ApiException, ISerializable
- Inheritance
-
ElasticsearchGetByIdException
- Implements
- Inherited Members
Remarks
This exception is designed to capture relevant information about the failed operation, including the document ID, document type, and API call details, to aid in diagnosing the failure.
Constructors
ElasticsearchGetByIdException()
Initializes a new instance of the ApiException class with a default error message.
public ElasticsearchGetByIdException()
ElasticsearchGetByIdException(int, string?, Exception?)
Initializes a new instance of the ApiException class with a specified status code, error message, and inner exception.
public ElasticsearchGetByIdException(int statusCode, string? message, Exception? innerException)
Parameters
statusCodeintThe HTTP status code associated with the exception.
messagestringThe error message describing the exception. If null, a default message is used.
innerExceptionExceptionThe exception that caused the current exception.
Exceptions
- ArgumentOutOfRangeException
Thrown if the
statusCodeis outside the valid range (100-599).
ElasticsearchGetByIdException(string)
Initializes a new instance of the ApiException class with a specified error message.
public ElasticsearchGetByIdException(string message)
Parameters
messagestringThe error message describing the exception.
ElasticsearchGetByIdException(string, Exception?)
Initializes a new instance of the ApiException class with a specified error message and an inner exception that caused this exception.
public ElasticsearchGetByIdException(string message, Exception? innerException)
Parameters
messagestringThe error message describing the exception.
innerExceptionExceptionThe exception that caused the current exception.
ElasticsearchGetByIdException(string, Type?, string, Exception?)
Initializes a new instance of the ElasticsearchGetByIdException class with the specified details.
public ElasticsearchGetByIdException(string documentId, Type? documentType, string apiCallDetails, Exception? innerException = null)
Parameters
documentIdstringThe ID of the document that could not be retrieved.
documentTypeTypeThe type of the document that could not be retrieved.
apiCallDetailsstringDetails of the API call that failed.
innerExceptionExceptionThe inner exception that caused this exception, if any.
Exceptions
- ArgumentException
Thrown if
documentIdorapiCallDetailsis null, empty, or whitespace.- ArgumentNullException
Thrown if
documentTypeis null.
Properties
ApiCallDetails
Gets details of the API call that failed.
public string ApiCallDetails { get; }
Property Value
- string
Details of the API call that failed.
DocumentId
Gets the ID of the document that could not be retrieved.
public string DocumentId { get; }
Property Value
- string
The ID of the document that could not be retrieved.
DocumentType
Gets the type of the document that could not be retrieved.
public Type? DocumentType { get; }
Property Value
- Type
The type of the document that could not be retrieved.