1use thiserror::Error;
2
3#[derive(Error, Debug, Clone)]
5pub enum FlashloanError {
6 #[error("Failed to create flashloan borrower contract deployer!")]
8 ContractDeployError,
9 #[error("Failed to deploy flashloan borrower contract!")]
11 ContractDeployFailed,
12 #[error("Missing flashloan borrower contract definition. Use the `FlashloanBuilder::with_borrower` method to set the contract address or deploy a new instance with `FlashloanBuilder::deploy`")]
14 MissingBorrower,
15 #[error("Failed to construct call: {0}")]
17 CallConstructionError(String),
18 #[error("Missing token address to borrow. Use the `FlashloanBuilder::with_token` method to set the token address")]
20 MissingToken,
21 #[error("Missing amount to borrow. Use the `FlashloanBuilder::with_amount` method to set the amount to borrow")]
23 MissingAmount,
24 #[error("Failed to execute contract call: {0}")]
26 ContractError(String),
27 #[error("Failed to get accounts from client. Error: {0}")]
29 ClientFailure(String),
30 #[error("Missing owner account. Use the `FlashloanBuilder::with_owner` method to set the owner account")]
32 MissingOwner,
33}