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
55
56
57
use std::error::Error as StdError;
use thiserror::Error;
#[cfg(feature = "storage")]
#[cfg_attr(docsrs, doc(cfg(feature = "storage")))]
use crate::storage::StorageError;
pub(crate) type BoxDynError = Box<dyn StdError + 'static + Send + Sync>;
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum JobError {
#[error("Attempted to communicate with a crashed background worker")]
WorkerCrashed,
#[error("Job Failed: {0}")]
Failed(#[source] BoxDynError),
#[cfg(feature = "storage")]
#[cfg_attr(docsrs, doc(cfg(feature = "storage")))]
#[error("Error communicating with storage: {0}")]
Storage(StorageError),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Unknown error")]
Unknown,
}
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum WorkerError {
#[cfg(feature = "storage")]
#[cfg_attr(docsrs, doc(cfg(feature = "storage")))]
#[error("error communicating with storage: {0}")]
Storage(StorageError),
}
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum JobStreamError {
#[error("Broken Pipe: {0}")]
BrokenPipe(#[source] BoxDynError),
}