dgraph_tonic/errors/
client.rs

1use thiserror::Error as Fail;
2
3use crate::Status;
4
5///
6/// Possible errors for client
7///
8#[derive(Debug, Fail)]
9pub enum Error {
10    #[error("Client: invalid endpoint")]
11    InvalidEndpoint,
12    #[error("Client: no endpoints defined")]
13    NoEndpointsDefined,
14    #[error("Client: cannot do alter on DB.\n{0:?}")]
15    CannotAlter(Status),
16    #[error("Client: cannot login.\n{0:?}")]
17    CannotLogin(Status),
18    #[error("Client: cannot refresh login.\n{0:?}")]
19    CannotRefreshLogin(Status),
20    #[error("Client: cannot query.\n{0:?}")]
21    CannotQuery(Status),
22    #[error("Client: cannot mutate.\n{0:?}")]
23    CannotMutate(Status),
24    #[error("Client: cannot do request.\n{0:?}")]
25    CannotDoRequest(Status),
26    #[error("Client: cannot commit or abort.\n{0:?}")]
27    CannotCommitOrAbort(Status),
28    #[error("Client: cannot check version.\n{0:?}")]
29    CannotCheckVersion(Status),
30}