drive_abci/error/
query.rs1use dpp::platform_value::Error as ValueError;
2use dpp::util::deserializer::ProtocolVersion;
3use dpp::version::FeatureVersion;
4use dpp::ProtocolError;
5use drive::error::proof::ProofError;
6use drive::error::query::QuerySyntaxError as SyntaxError;
7use drive::error::Error as DriveError;
8use prost::DecodeError;
9use tenderdash_abci::proto::abci::ResponseException;
10
11#[derive(Debug, thiserror::Error)]
14pub enum QueryError {
15 #[error("proof error: {0}")]
17 Proof(#[from] ProofError),
18
19 #[error("query syntax error: {0}")]
21 Query(#[from] SyntaxError),
22
23 #[error("protocol error: {0}")]
25 Protocol(#[from] ProtocolError),
26
27 #[error("query value error: {0}")]
29 Value(#[from] ValueError),
30
31 #[error("drive error: {0}")]
33 Drive(#[from] DriveError),
34
35 #[error("protobuf decoding error: {0}")]
37 ProtobufDecode(#[from] DecodeError),
38
39 #[error("invalid argument error: {0}")]
41 InvalidArgument(String),
42
43 #[error("too many elements error: {0}")]
45 TooManyElements(String),
46
47 #[error("not found error: {0}")]
49 NotFound(String),
50
51 #[error("query not serviceable: {0}")]
53 NotServiceable(String),
54
55 #[error("decoding error: {0}")]
57 DecodingError(String),
58
59 #[error("unsupported version for query: {0}, currently supporting versions {1} to {2} on platform protocol {3}, given {4}")]
61 UnsupportedQueryVersion(
62 String,
63 FeatureVersion,
64 FeatureVersion,
65 ProtocolVersion,
66 FeatureVersion,
67 ),
68}
69
70impl From<QueryError> for ResponseException {
71 fn from(value: QueryError) -> Self {
72 Self {
73 error: value.to_string(),
74 }
75 }
76}