use thiserror::Error;
pub type Result<T> = std::result::Result<T, SchedulerError>;
#[derive(Debug, Error)]
pub enum SchedulerError {
#[error("Database error: {0}")]
Database(#[from] rusqlite::Error),
#[error("Azoth error: {0}")]
Azoth(#[from] azoth_core::error::AzothError),
#[error("Serialization error: {0}")]
Serialization(#[from] serde_json::Error),
#[error("Invalid schedule: {0}")]
InvalidSchedule(String),
#[error("Task handler not found: {0}")]
HandlerNotFound(String),
#[error("Task handler error: {0}")]
HandlerError(String),
#[error("Task execution timeout")]
Timeout,
#[error("Task not found: {0}")]
TaskNotFound(String),
#[error("Invalid task configuration: {0}")]
InvalidTask(String),
#[error("Cron parsing error: {0}")]
CronParse(#[from] cron::error::Error),
#[error("{0}")]
Other(String),
}