File tree Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -7,3 +7,4 @@ edition = "2018"
7
7
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8
8
9
9
[dependencies ]
10
+ thiserror = " 1.0.24"
Original file line number Diff line number Diff line change
1
+ use thiserror:: Error ;
2
+
3
+ #[ derive( Error , Debug ) ]
4
+ pub enum TypesenseError {
5
+ /// Config error.
6
+ #[ error( "config error" ) ]
7
+ ConfigError ,
8
+
9
+ /// Timeout.
10
+ #[ error( "timeout" ) ]
11
+ Timeout ,
12
+
13
+ /// Request malformed.
14
+ #[ error( "request malformed" ) ]
15
+ RequestMalformed ,
16
+
17
+ /// Request unauthorized.
18
+ #[ error( "request unauthorized" ) ]
19
+ RequestUnauthorized ,
20
+
21
+ /// Request forbidden.
22
+ #[ error( "request forbidden" ) ]
23
+ RequestForbidden ,
24
+
25
+ /// Object not found.
26
+ #[ error( "object not found" ) ]
27
+ ObjectNotFound ,
28
+
29
+ /// Object already exists.
30
+ #[ error( "object already exists" ) ]
31
+ ObjectAlreadyExists ,
32
+
33
+ /// Object unprocessable.
34
+ #[ error( "object unprocessable" ) ]
35
+ ObjectUnprocessable ,
36
+
37
+ /// Server error.
38
+ #[ error( "server error" ) ]
39
+ ServerError ,
40
+
41
+ /// Service unavailable.
42
+ #[ error( "service unavailable" ) ]
43
+ ServiceUnavailable ,
44
+
45
+ /// HTTP status error.
46
+ #[ error( "HTTP status error" ) ]
47
+ HTTPStatusError ,
48
+ }
Original file line number Diff line number Diff line change 2
2
//! # Typesense
3
3
//!
4
4
//! Welcome to typesense, the rust library for the Typesense API.
5
+
6
+ mod error;
You can’t perform that action at this time.
0 commit comments