1use {
2 cosmwasm_std::StdError,
3 thiserror::Error,
4};
5
6#[derive(Error, Debug)]
7pub enum PythContractError {
8 #[error("PermissionDenied")]
10 PermissionDenied,
11
12 #[error("PriceFeedNotFound")]
14 PriceFeedNotFound,
15
16 #[error("InvalidUpdateMessageEmitter")]
18 InvalidUpdateEmitter,
19
20 #[error("InvalidUpdatePayload")]
22 InvalidUpdatePayload,
23
24 #[error("DataSourceDoesNotExists")]
26 DataSourceDoesNotExists,
27
28 #[error("DataSourceAlreadyExists")]
30 DataSourceAlreadyExists,
31
32 #[error("InvalidGovernanceEmitter")]
34 InvalidGovernanceEmitter,
35
36 #[error("InvalidGovernancePayload")]
38 InvalidGovernancePayload,
39
40 #[error("OldGovernanceMessage")]
42 OldGovernanceMessage,
43
44 #[error("OldGovernanceMessage")]
46 InvalidGovernanceSourceIndex,
47
48 #[error("InsufficientFee")]
50 InsufficientFee,
51
52 #[error("InvalidFeeDenom")]
54 InvalidFeeDenom { denom: String },
55}
56
57impl From<PythContractError> for StdError {
58 fn from(other: PythContractError) -> StdError {
59 StdError::GenericErr {
60 msg: format!("{other}"),
61 }
62 }
63}