In pyth-sdk-solana, there is a function converting PythError to ProgramError defined in the solana_program crate. However, there is no conversion to Error defined in the anchor_lang crate, making it a bit difficult to handle error in contracts written with Anchor.
Ali suggested me opening an issue here for improvement.