vialabs_stellar_common/errors.rs
1/// # Errors Module
2///
3/// This module provides error types for contract operations.
4use soroban_sdk::contracterror;
5
6#[contracterror]
7#[derive(Copy, Clone, Debug, PartialEq)]
8pub enum Error {
9 /// Invalid number of signatures provided
10 InvalidSignatureCount = 1,
11 /// The system is not enabled
12 SystemNotEnabled = 2,
13 /// Recipient address is zero
14 RecipientZeroAddress = 3,
15 /// Fee was not paid
16 FeeNotPaid = 4,
17 /// Transaction has already been processed
18 TransactionAlreadyProcessed = 5,
19 /// Relayer is not authorized
20 RelayerNotAuthorized = 6,
21 /// Caller is not a relayer
22 CallerNotRelayer = 7,
23 /// Gas refund failed
24 GasRefundFailed = 8,
25 /// Invalid key provided
26 InvalidKey = 9,
27 /// Duplicate signer detected
28 DuplicateSignerDetected = 10,
29 /// Insufficient project signatures
30 InsufficientProjectSignatures = 11,
31 /// Insufficient chain signatures
32 InsufficientChainSignatures = 12,
33 /// Insufficient VIA signatures
34 InsufficientVIASignatures = 13,
35 /// POS (Proof of Stake) validation failed
36 POSValidationFailed = 14,
37 /// Chains and endpoints arrays have mismatched lengths
38 ChainsEndpointsMislength = 15,
39 /// Message gateway is not set
40 MissingMessageGateway = 16,
41 /// Chain endpoint is not configured
42 MissingChainEndpoint = 17,
43 /// Caller is not the gateway
44 CallerNotGateway = 18,
45 /// Gas amount exceeds maximum allowed
46 GasAmountExceedsMaxGasAmount = 19,
47 /// Gas amount is not authorized
48 GasAmountNotAuthorized = 20,
49 /// Insufficient balance
50 InsufficientBalance = 21,
51 /// Gas token contract is not set
52 GasTokenContractNotSet = 22,
53 /// Maximum fee exceeds maximum fee amount
54 MaxFeeExceededMaxFeeAmount = 23,
55 /// Fee token contract is not set
56 FeeTokenContractNotSet = 24,
57 /// Fee amount is not authorized
58 FeeAmountNotAuthorized = 25,
59 /// Invalid recipient address
60 InvalidRecipient = 26,
61 /// Invalid amount (e.g., zero or negative)
62 InvalidAmount = 27,
63 /// Amount overflow occurred
64 AmountOverflow = 28,
65 /// Sender length doesn't match expected length
66 SenderLengthMismatch = 29,
67 /// Invalid chain sender
68 InvalidChainSender = 30,
69 /// Address XDR representation is too short
70 AddressXDRRepresentationTooShort = 31,
71 /// Owner is not set
72 OwnerNotSet = 32,
73 /// Chain details not found
74 ChainDetailsNotFound = 33,
75 /// Invalid public key
76 InvalidPublicKey = 34,
77 /// Owner has already been set
78 OwnerAlreadySet = 35,
79 /// Unauthorized contract caller
80 UnauthorizedContractCaller = 36,
81 /// Unauthorized bridge caller
82 UnauthorizedBridgeCaller = 37,
83 /// Text message is too long
84 TextTooLong = 38,
85 /// Invalid XDR address format
86 InvalidXDRAddress = 39,
87}