1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*!
Client-side error types.
The main `Error` type combines the various kinds of errors that can occur when interacting with Elasticsearch.
# Examples
Any method defined in `elastic` that could fail will return a `Result<T, Error>` that can be matched on.
The below example sends a request and then checks the response for an `ErrorKind::Api`:
```no_run
# use elastic::prelude::*;
# use elastic::error::*;
# let client = Client::new(RequestParams::default()).unwrap();
# let req = PingRequest::new();
// Send a request.
// This will return a Result<ResponseBuilder, Error>
let res = client.request(req).send();
match res {
Ok(response) => {
// do something with the response
},
Err(e) => {
match *e.kind() {
ErrorKind::Api(ref e) => {
// handle a REST API error
},
ref e => {
// handle a HTTP or JSON error
}
}
}
}
```
*/
use Error as JsonError;
use Error as ReqwestError;
use ResponseError;
pub use ;
error_chain!