1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use cosmwasm_std::{DivideByZeroError, StdError};
use komple_framework_utils::{funds::FundsError, shared::SharedError, UtilError};
use thiserror::Error;

#[derive(Error, Debug, PartialEq)]
pub enum ContractError {
    #[error("{0}")]
    Std(#[from] StdError),

    #[error("Unauthorized")]
    Unauthorized {},

    #[error("Execute locked")]
    ExecuteLocked {},

    #[error("Invalid fee")]
    InvalidFee {},

    #[error("Fee already exists")]
    ExistingFee {},

    #[error("Share already exists")]
    ExistingShare {},

    #[error("Fee not found")]
    FeeNotFound {},

    #[error("Total fee cannot exceed 1")]
    InvalidTotalFee {},

    #[error("No payments found for distribution")]
    NoPaymentsFound {},

    #[error("{0}")]
    DivideByZeroError(#[from] DivideByZeroError),

    #[error("{0}")]
    UtilError(#[from] UtilError),

    #[error("{0}")]
    FundsError(#[from] FundsError),

    #[error("{0}")]
    SharedError(#[from] SharedError),
}