use rialo_s_instruction::error::InstructionError;
use rialo_s_program_error::{PrintProgramError, ProgramError};
#[derive(Debug, Clone, PartialEq, Eq)]
#[repr(u32)]
pub enum FeatureManagementError {
Unauthorized = 0,
InvalidFeatureName = 1,
FeatureNotFound = 2,
SerializationError = 3,
DeserializationError = 4,
InvalidInstructionData = 5,
InternalError = 6,
DuplicateFeature = 7,
InvalidStorageAccount = 8,
AlreadyInitialized = 9,
NotInitialized = 10,
MaxFeatureCountExceeded = 11,
TooManyNames = 12,
NoPendingTransfer = 13,
PendingTransferExists = 14,
InvalidTransferTarget = 15,
ScheduleInPast = 16,
ScheduleTooFarOut = 17,
RequestNotFound = 18,
TooManyPendingRequests = 19,
RequestAlreadyExists = 20,
PendingStateTooLarge = 21,
}
impl From<FeatureManagementError> for ProgramError {
fn from(e: FeatureManagementError) -> Self {
ProgramError::Custom(e as u32)
}
}
impl From<FeatureManagementError> for InstructionError {
fn from(e: FeatureManagementError) -> Self {
InstructionError::Custom(e as u32)
}
}
impl PrintProgramError for FeatureManagementError {
fn print<E>(&self) {}
}