1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use crate::prelude::*;
#[derive(Error, Debug)]
pub enum TaskError {
#[error("Cron expression analysis error.")]
CronExpressionAnalyzeError(#[from] CronExpressionAnalyzeError),
#[error("Task sending failure.")]
DisSend(#[from] channel::TrySendError<TimerEvent>),
#[error("Task event get failed.")]
DisGetEvent(#[from] channel::TryRecvError),
}
#[derive(Error, Debug)]
pub enum TaskInstanceError {
#[error("TaskInstance sending failure.")]
DisSend(#[from] channel::TrySendError<TimerEvent>),
#[error("TaskInstance event get failed.")]
DisGetEvent(#[from] channel::TryRecvError),
#[error("The task has been (completed or canceled) and cannot be cancelled.")]
DisCancel,
#[error("Waiting for cancellation timeout.")]
DisCancelTimeOut,
#[error("Missing `timer_event_sender`.")]
MisEventSender,
#[error("Task instance channel exception.")]
InternalChannelAnomaly(#[from] channel::RecvError),
#[error("Running instance of the task is no longer maintained.")]
Expired,
}
#[derive(Error, Debug)]
pub enum CronExpressionAnalyzeError {
#[error("Thread local storage access failed.")]
DisAccess(#[from] std::thread::AccessError),
#[error("The cron expression was parsed incorrectly.")]
DisParse(#[from] cron_error::Error),
}