astroport_router/
error.rs1use cosmwasm_std::{OverflowError, StdError, Uint128};
2use thiserror::Error;
3
4#[derive(Error, Debug, PartialEq)]
6pub enum ContractError {
7 #[error("{0}")]
8 Std(#[from] StdError),
9
10 #[error("{0}")]
11 OverflowError(#[from] OverflowError),
12
13 #[error("Unauthorized")]
14 Unauthorized {},
15
16 #[error(
17 "The next offer asset must be the same as the previous ask asset; \
18 {prev_ask_asset} --> {next_offer_asset} --> {next_ask_asset}"
19 )]
20 InvalidPathOperations {
21 prev_ask_asset: String,
22 next_offer_asset: String,
23 next_ask_asset: String,
24 },
25
26 #[error("Doubling assets in one batch of path; {offer_asset} --> {ask_asset}")]
27 DoublingAssetsPath {
28 offer_asset: String,
29 ask_asset: String,
30 },
31
32 #[error("Must specify swap operations!")]
33 MustProvideOperations {},
34
35 #[error("Assertion failed; minimum receive amount: {receive}, swap amount: {amount}")]
36 AssertionMinimumReceive { receive: Uint128, amount: Uint128 },
37
38 #[error("The swap operation limit was exceeded!")]
39 SwapLimitExceeded {},
40
41 #[error("Native swap operations are not supported!")]
42 NativeSwapNotSupported {},
43
44 #[error("Contract can't be migrated!")]
45 MigrationError {},
46}