public ElasticsearchClientException(PipelineFailure failure, string message, IApiCallDetails apiCall) : this(message) { Response = apiCall; FailureReason = failure; AuditTrail = apiCall?.AuditTrail; }
private static string GetMessage(PipelineFailure failure) { switch (failure) { case PipelineFailure.BadRequest: return("An error occurred trying to write the request data to the specified node."); case PipelineFailure.BadResponse: return("An error occurred trying to read the response from the specified node."); case PipelineFailure.BadAuthentication: return("Could not authenticate with the specified node. Try verifying your credentials or check your Shield configuration."); case PipelineFailure.PingFailure: return("Failed to ping the specified node."); case PipelineFailure.SniffFailure: return("Failed sniffing cluster state."); case PipelineFailure.CouldNotStartSniffOnStartup: return("Failed sniffing cluster state upon client startup."); case PipelineFailure.MaxTimeoutReached: return("Maximum timeout was reached."); case PipelineFailure.MaxRetriesReached: return("The call was retried the configured maximum amount of times"); case PipelineFailure.NoNodesAttempted: return("No nodes were attempted, this can happen when a node predicate does not match any nodes"); case PipelineFailure.Unexpected: default: return("An unexpected error occurred. Try checking the original exception for more information."); } }
private static string GetMessage(PipelineFailure failure) { switch (failure) { case PipelineFailure.BadRequest: return("An error occurred trying to write the request datato the specified node."); case PipelineFailure.BadResponse: return("An error occurred trying to read the response from the specified node."); case PipelineFailure.BadAuthentication: return("Could not authenticate with the specified node. Try verifying your credentials or check your Shield configuration."); case PipelineFailure.PingFailure: return("Failed to ping the specified node."); case PipelineFailure.SniffFailure: return("Failed sniffing cluster state."); case PipelineFailure.CouldNotStartSniffOnStartup: return("Failed sniffing cluster state upon client startup."); default: return("An unexpected error occurred. Try checking the original exception for more information."); } }
private static string GetMessage(PipelineFailure failure) { switch(failure) { case PipelineFailure.BadResponse: return "An error occurred trying to establish a connection with the specified node."; case PipelineFailure.BadAuthentication: return "Could not authenticate with the specified node. Try verifying your credentials or check your Shield configuration."; case PipelineFailure.PingFailure: return "Failed to ping the specified node."; case PipelineFailure.SniffFailure: return "Failed sniffing cluster state."; case PipelineFailure.CouldNotStartSniffOnStartup: return "Failed sniffing cluster state upon client startup."; default: return "An unexpected error occurred. Try checking the original exception for more information."; } }
public PipelineException(PipelineFailure failure) : base(GetMessage(failure)) => FailureReason = failure;
public ElasticsearchClientException(PipelineFailure failure, string message, Exception innerException) : base(message, innerException) { FailureReason = failure; }
public PipelineException(PipelineFailure failure, Exception innerException) : base(GetMessage(failure), innerException) { this.FailureReason = failure; }
public PipelineException(string message) : base(message) { this.FailureReason = PipelineFailure.BadResponse; }
//|| FailureReason == FailureReason.Unexpected; public PipelineException(PipelineFailure failure) : base(GetMessage(failure)) { this.FailureReason = failure; }
public ElasticsearchException(PipelineFailure cause, IApiCallDetails response, Exception innerException) : base("", innerException) { this.Cause = cause; this.Response = response; }
//TODO make sure the exception messages are gorgeous public ElasticsearchException(PipelineFailure cause, Exception innerException) : base("", innerException) { this.Cause = cause; }