Пример #1
0
 public ElasticsearchClientException(PipelineFailure failure, string message, IApiCallDetails apiCall)
     : this(message)
 {
     Response      = apiCall;
     FailureReason = failure;
     AuditTrail    = apiCall?.AuditTrail;
 }
Пример #2
0
        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.");
            }
        }
Пример #3
0
        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.");
            }
        }
		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.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.";
			}
		}
Пример #6
0
 public PipelineException(PipelineFailure failure)
     : base(GetMessage(failure)) => FailureReason = failure;
Пример #7
0
 public ElasticsearchClientException(PipelineFailure failure, string message, Exception innerException)
     : base(message, innerException)
 {
     FailureReason = failure;
 }
Пример #8
0
 public PipelineException(PipelineFailure failure, Exception innerException)
     : base(GetMessage(failure), innerException)
 {
     this.FailureReason = failure;
 }
		public ElasticsearchClientException(PipelineFailure failure, string message, Exception innerException)
			: base(message, innerException)
		{
			FailureReason = failure;
		}
Пример #10
0
 public PipelineException(string message)
     : base(message)
 {
     this.FailureReason = PipelineFailure.BadResponse;
 }
Пример #11
0
		public PipelineException(PipelineFailure failure, Exception innerException) 
			: base(GetMessage(failure), innerException)
		{
			this.FailureReason = failure;
		}
Пример #12
0
		public PipelineException(string message)
			: base(message)
		{
			this.FailureReason = PipelineFailure.BadResponse;
		}
Пример #13
0
			//|| FailureReason == FailureReason.Unexpected;

		public PipelineException(PipelineFailure failure)
			: base(GetMessage(failure))
		{
			this.FailureReason = failure;
		}
Пример #14
0
 public ElasticsearchException(PipelineFailure cause, IApiCallDetails response, Exception innerException) : base("", innerException)
 {
     this.Cause    = cause;
     this.Response = response;
 }
Пример #15
0
 //TODO make sure the exception messages are gorgeous
 public ElasticsearchException(PipelineFailure cause, Exception innerException) : base("", innerException)
 {
     this.Cause = cause;
 }