use {
cosmwasm_std::StdError,
thiserror::Error,
};
#[derive(Error, Debug)]
pub enum PythContractError {
#[error("PermissionDenied")]
PermissionDenied,
#[error("PriceFeedNotFound")]
PriceFeedNotFound,
#[error("InvalidUpdateMessageEmitter")]
InvalidUpdateEmitter,
#[error("InvalidUpdatePayload")]
InvalidUpdatePayload,
#[error("DataSourceDoesNotExists")]
DataSourceDoesNotExists,
#[error("DataSourceAlreadyExists")]
DataSourceAlreadyExists,
#[error("InvalidGovernanceEmitter")]
InvalidGovernanceEmitter,
#[error("InvalidGovernancePayload")]
InvalidGovernancePayload,
#[error("OldGovernanceMessage")]
OldGovernanceMessage,
#[error("OldGovernanceMessage")]
InvalidGovernanceSourceIndex,
#[error("InsufficientFee")]
InsufficientFee,
#[error("InvalidFeeDenom")]
InvalidFeeDenom { denom: String },
}
impl From<PythContractError> for StdError {
fn from(other: PythContractError) -> StdError {
StdError::GenericErr {
msg: format!("{other}"),
}
}
}