use anchor_lang::prelude::*;
#[error_code]
pub enum ClockworkError {
#[msg("The exec response could not be parsed")]
InvalidThreadResponse,
#[msg("The thread is in an invalid state")]
InvalidThreadState,
#[msg("The trigger variant cannot be changed")]
InvalidTriggerVariant,
#[msg("The trigger condition has not been activated")]
TriggerConditionFailed,
#[msg("This operation cannot be processes because the thread is currently busy")]
ThreadBusy,
#[msg("The thread is currently paused")]
ThreadPaused,
#[msg("The thread's rate limit has been reached")]
RateLimitExeceeded,
#[msg("Thread rate limits cannot exceed the maximum allowed value")]
MaxRateLimitExceeded,
#[msg("Inner instruction attempted to write to an unauthorized address")]
UnauthorizedWrite,
#[msg("Withdrawing this amount would leave the thread with less than the minimum required SOL for rent exemption")]
WithdrawalTooLarge,
}