Error messages

// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.13;

/**
 * @title Errors library
 * @dev Defines the errors used in the Revolving credit line product
 */
library RevolvingCreditLineErrors {
    error RCL_ONLY_LENDER(); // "Operation restricted to lender only"
    error RCL_ONLY_BORROWER(); // "Operation restricted to borrower only"
    error RCL_ONLY_OPERATOR(); // "Operation restricted to operator only"

    error RCL_OUT_OF_BOUND_MIN_RATE(); // "Input rate is below min rate"
    error RCL_OUT_OF_BOUND_MAX_RATE(); // "Input rate is above max rate"
    error RCL_INVALID_RATE_SPACING(); // "Input rate is invalid with respect to rate spacing"
    error RCL_INVALID_PHASE(); // "Phase is invalid for this operation"
    error RCL_BORROW_AMOUNT_TOO_LOW(); // "Borrow amount is too low"
    error RCL_DEPOSIT_AMOUNT_TOO_LOW(); // "Deposit amount is too low"
    error RCL_NO_LIQUIDITY(); // "No liquidity available for the amount to borrow"
    error RCL_LOAN_RUNNING(); // "Loan has not reached maturity"
    error RCL_AMOUNT_EXCEEDS_MAX(); // "Amount exceeds maximum allowed"
    error RCL_NO_LOAN_RUNNING(); // No loan currently running
    error RCL_ONLY_OWNER(); // Has to be position owner
    error RCL_TIMELOCK(); // ActionNot possible within this block
    error RCL_CANNOT_EXIT(); // Cannot exit after maturity
    error RCL_POSITION_NOT_BORROWED(); // The positions is currently not under a borrow
    error RCL_POSITION_BORROWED(); // The positions is currently under a borrow
    error RCL_POSITION_NOT_FULLY_BORROWED(); // The position is currently not fully borrowed
    error RCL_POSITION_FULLY_BORROWED(); // The position is currently fully borrowed
    error RCL_HAS_OPTED_OUT(); // Position that already opted out cannot make the target action
    error RCL_REPAY_TOO_EARLY(); // Cannot repay before repayment period started
    error RCL_WRONG_INPUT(); // The specified input does not pass validation
    error RCL_REMAINING_AMOUNT_TOO_LOW(); // Withdraw or exit cannot result in the position being worth less than the minimum deposit
    error RCL_AMOUNT_TOO_HIGH(); // Cannot withdraw more than the position current value
    error RCL_AMOUNT_TOO_LOW(); // Cannot withdraw less that the minimum position deposit
    error RCL_MATURITY_PASSED(); // Cannot perform the target action after maturity
    error RCL_OPT_OUT_NOT_ACTIVE(); // Opt out is not active at the moment
    error RCL_DETACH_NOT_ACTIVE(); // Detach is not active at the moment
    error RCL_LOAN_IN_ROLLOVER_PERIOD(); // Loan is currently in rollover period, action not permitted

    error RCL_INVALID_FEES_CONTROLLER_MANAGED_POOL(); // "Managed pool of fees controller is not the instance one"
}

Last updated