Class ElasticsearchIndexingException
- Namespace
- Excalibur.Data.ElasticSearch.Exceptions
- Assembly
- Excalibur.Data.ElasticSearch.dll
Represents an exception that is thrown when an attempt to index a document in Elasticsearch fails.
public sealed class ElasticsearchIndexingException : ApiException, ISerializable
- Inheritance
-
ElasticsearchIndexingException
- Implements
- Inherited Members
Remarks
This exception provides detailed information about the failed operation, including the index name, document type, and details about the API call.
Constructors
ElasticsearchIndexingException()
Initializes a new instance of the ApiException class with a default error message.
public ElasticsearchIndexingException()
ElasticsearchIndexingException(int, string?, Exception?)
Initializes a new instance of the ApiException class with a specified status code, error message, and inner exception.
public ElasticsearchIndexingException(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).
ElasticsearchIndexingException(string)
Initializes a new instance of the ApiException class with a specified error message.
public ElasticsearchIndexingException(string message)
Parameters
messagestringThe error message describing the exception.
ElasticsearchIndexingException(string, Exception?)
Initializes a new instance of the ApiException class with a specified error message and an inner exception that caused this exception.
public ElasticsearchIndexingException(string message, Exception? innerException)
Parameters
messagestringThe error message describing the exception.
innerExceptionExceptionThe exception that caused the current exception.
ElasticsearchIndexingException(string, Type?, string, Exception?)
Initializes a new instance of the ElasticsearchIndexingException class with the specified details.
public ElasticsearchIndexingException(string indexName, Type? documentType, string apiCallDetails, Exception? innerException = null)
Parameters
indexNamestringThe name of the Elasticsearch index where the operation failed.
documentTypeTypeThe type of the document that failed to index.
apiCallDetailsstringDetails about the API call that failed.
innerExceptionExceptionThe inner exception that caused this exception, if any.
Exceptions
- ArgumentException
Thrown if
indexNameorapiCallDetailsis null, empty, or whitespace.- ArgumentNullException
Thrown if
documentTypeis null.
Properties
ApiCallDetails
Gets details about the API call that failed.
public string ApiCallDetails { get; }
Property Value
- string
Details about the API call that failed.
DocumentType
Gets the type of the document that failed to index.
public Type? DocumentType { get; }
Property Value
- Type
The type of the document that failed to index.
IndexName
Gets the name of the Elasticsearch index where the operation failed.
public string IndexName { get; }
Property Value
- string
The name of the Elasticsearch index where the operation failed.