use thiserror::Error;
#[derive(Error, Debug)]
pub enum TaskError {
#[error("Task not initialized yet")]
NotInitialized,
#[error("Task already executed and must be rescheduled")]
AlreadyExecuted,
#[error("Task failed and must be rescheduled")]
Failed,
#[error("Task has finished and must be removed")]
Finished,
#[error("Task has been force removed")]
ForceRemoved,
#[error("Invalid cron expression: {0}")]
InvalidCronExpression(String),
#[error("Missing required component: {0}")]
MissingComponent(String),
#[error("Task execution error: {0}")]
ExecutionError(String),
}
pub type TaskResult<T> = Result<T, TaskError>;