Skip to main content

coil_runtime/jobs/
errors.rs

1use super::super::*;
2
3#[derive(Debug, Error, PartialEq, Eq)]
4pub enum RuntimeJobsError {
5    #[error(transparent)]
6    Jobs(#[from] JobsModelError),
7    #[error("runtime value `{field}` cannot be empty")]
8    EmptyValue { field: &'static str },
9    #[error("job `{job}` is not declared by the runtime")]
10    UnknownJob { job: String },
11    #[error("job `{job}` must be dispatched through a domain event")]
12    DomainEventJobRequiresEventDispatch { job: String },
13    #[error("scheduled job `{job}` requires a scheduled execution instant")]
14    ScheduledJobRequiresSchedule { job: String },
15    #[error("job `{job}` uses trigger `{trigger:?}` and cannot be scheduled explicitly")]
16    UnexpectedSchedule {
17        job: String,
18        trigger: JobTriggerKind,
19    },
20    #[error("job `{job}` requires an explicit idempotency key")]
21    MissingIdempotencyKey { job: String },
22}