//iffy side effect assignment to exceptionType needed so that we simply return message to the //base constructor. private static string ParseError(ElasticsearchServerError error) { if (error == null) return _couldNotParseServerException; if (error.Error.IsNullOrEmpty()) return _couldNotParseServerException; var matches = ExceptionSplitter.Match(error.Error); if (matches.Groups.Count != 3) return _couldNotParseServerException; error.ExceptionType = matches.Groups[1].Value; return matches.Groups[2].Value; }
//iffy side effect assignment to exceptionType needed so that we simply return message to the //base constructor. private static string ParseError(ElasticsearchServerError error) { if (error == null) { return(_couldNotParseServerException); } if (error.Error.IsNullOrEmpty()) { return(_couldNotParseServerException); } var matches = ExceptionSplitter.Match(error.Error); if (matches.Groups.Count != 3) { return(_couldNotParseServerException); } error.ExceptionType = matches.Groups[1].Value; return(matches.Groups[2].Value); }
public ElasticClientQueryObjectException(ElasticsearchServerError error) : base(error) { }
public ElasticsearchServerException(ElasticsearchServerError error) : base(ParseError(error)) { this.Status = error.Status; this.ExceptionType = error.ExceptionType; }
public ElasticsearchServerException(ElasticsearchServerError error) : base(ParseError(error)) { this.Status = error.Status; this.ExceptionType = error.ExceptionType; }
public ElasticsearchException(ElasticsearchServerError error) : this(error.Error, error.ExceptionType, error.Status) { }