-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patherror.rs
More file actions
38 lines (36 loc) · 1.26 KB
/
error.rs
File metadata and controls
38 lines (36 loc) · 1.26 KB
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
use dojo_world::contracts::model::ModelError;
use starknet::core::types::Felt;
use starknet::core::utils::{CairoShortStringToFeltError, ParseCairoShortStringError};
use torii_proto::error::ProtoError;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Subscription service uninitialized")]
SubscriptionUninitialized,
#[error("Invalid model name: {0}. Expected format is \"namespace-model\"")]
InvalidModelName(String),
#[error("Unknown model: {0}")]
UnknownModel(Felt),
#[error("Parsing error: {0}")]
Parse(#[from] ParseError),
#[error(transparent)]
GrpcClient(#[from] torii_grpc_client::Error),
#[error(transparent)]
RelayClient(#[from] torii_libp2p_client::error::Error),
#[error(transparent)]
Model(#[from] ModelError),
#[error("Unsupported query")]
UnsupportedQuery,
#[error(transparent)]
Proto(#[from] ProtoError),
}
#[derive(Debug, thiserror::Error)]
pub enum ParseError {
#[error(transparent)]
Url(#[from] url::ParseError),
#[error(transparent)]
FeltFromStr(#[from] starknet::core::types::FromStrError),
#[error(transparent)]
CairoShortStringToFelt(#[from] CairoShortStringToFeltError),
#[error(transparent)]
ParseCairoShortString(#[from] ParseCairoShortStringError),
}