pyth_solana_receiver_sdk_legacy/
error.rs1use anchor_lang::error_code;
2
3#[error_code]
4#[derive(PartialEq)]
5pub enum GetPriceError {
6 #[msg("This price feed update's age exceeds the requested maximum age")]
7 PriceTooOld = 10000, #[msg("The price feed update doesn't match the requested feed id")]
9 MismatchedFeedId,
10 #[msg("This price feed update has a lower verification level than the one requested")]
11 InsufficientVerificationLevel,
12 #[msg("Feed id must be 32 Bytes, that's 64 hex characters or 66 with a 0x prefix")]
13 FeedIdMustBe32Bytes,
14 #[msg("Feed id contains non-hex characters")]
15 FeedIdNonHexCharacter,
16}
17
18#[macro_export]
19macro_rules! check {
20 ($cond:expr, $err:expr) => {
21 if !$cond {
22 return Err($err);
23 }
24 };
25}