Error Code

The ErrorCode enum defines various error types that can occur within the iCoordinates protocol, providing meaningful messages to aid in debugging and handling exceptions. Below is a detailed explanation of each error code:

  • IllegalInput:

    #[error_msg("Illegal Input")]
    IllegalInput,
    • Explanation: This error is triggered when the provided input is not valid or suitable for the intended operation.

  • NotAdmin:

    #[error_msg("Not Admin")]
    NotAdmin,
    • Explanation: This error occurs when the user attempting an action is not an admin and lacks the necessary permissions.

  • NotOwner:

    #[error_msg("Not Owner")]
    NotOwner,
    • Explanation: This error is raised when a user attempts an action that should only be performed by the owner.

  • NotEnoughFund:

    #[error_msg("Not Enough Fund to Withdraw")]
    NotEnoughFund,
    • Explanation: This error is triggered when an attempted fund withdrawal exceeds the available balance.

  • AccountInitiatedTooLate:

    #[error_msg("Account Initiated later than Lucky Draw")]
    AccountInitiatedTooLate,
    • Explanation: This error is raised when an account is initiated after the lucky draw event has taken place.

  • NotInLuckyDrawRewardList:

    #[error_msg("Not In Lucky Draw Reward List")]
    NotInLuckyDrawRewardList,
    • Explanation: This error occurs when an account is not in the lucky draw reward list.

  • RewardTaken:

    rustCopy code#[error_msg("Reward Already Taken")]
    RewardTaken,
    • Explanation: This error indicates that the reward has already been taken.

  • AlreadyOnSale:

    #[error_msg("Coordinates already on Sale")]
    AlreadyOnSale,
    • Explanation: This error is triggered when attempting to put coordinates on sale that are already listed.

  • NotOnSale:

    #[error_msg("Coordinates not on Sale")]
    NotOnSale,
    • Explanation: This error occurs when attempting to interact with coordinates that are not listed for sale.

  • NotIdle:

    #[error_msg("Coordinates not idle")]
    NotIdle,
    • Explanation: This error is triggered when attempting to perform an action on coordinates that are not in an idle state.

  • NoTransferWhileOnSale:

    #[error_msg("Cannot Transfer While On Sale")]
    NoTransferWhileOnSale,
    • Explanation: This error is raised when attempting a transfer while the coordinates are listed for sale.

  • EndtimeShouldBeInTheFuture:

    #[error_msg("Endtime should be in the future")]
    EndtimeShouldBeInTheFuture,
    • Explanation: This error occurs if the specified endtime for an auction is not in the future.

  • NotOnAuction:

    #[error_msg("Not on Auction")]
    NotOnAuction,
    • Explanation: This error occurs when attempting to perform an action that requires the coordinates to be on auction, but they are not.

  • AuctionWithBidsCannotBeCancelled:

    #[error_msg("Auction with Bids cannot be Cancelled")]
    AuctionWithBidsCannotBeCancelled,
    • Explanation: This error is triggered when attempting to cancel an auction that has received bids.

  • AuctionWithZeroBidCannotBeConfirmed:

    #[error_msg("Cannot Purchase on Coordinates You Own")]
    AuctionWithZeroBidCannotBeConfirmed,
    • Explanation: This error occurs when attempting to confirm an auction with zero bids on coordinates you own.

  • IsOwner:

    #[error_msg("Cannot Be the Owner")]
    IsOwner,
    • Explanation: This error is raised when attempting an action that cannot be performed by the owner.

  • BidLowerThanPrevious:

    #[error_msg("Bid Needs to be Higher than Previous One")]
    BidLowerThanPrevious,
    • Explanation: This error is triggered if a bid is not higher than the previous bid in an auction.

  • AuctionIsClosed:

    #[error_msg("Auction is closed")]
    AuctionIsClosed,
    • Explanation: This error occurs when attempting to bid on a closed auction.

  • AuctionNotClosed:

    #[error_msg("Auction not closed")]
    AuctionNotClosed,
    • Explanation: This error is raised when attempting to confirm an auction that has not yet ended.

  • WrongPreviousBidderAccount

    #[error_msg("Wrong Previous Bidder Account")]
    WrongPreviousBidderAccount,
    • Explanation: This error is triggered when the previous bidder's account does not match the expected account in an auction scenario.

Last updated