Skip to main content

toku_core/
error.rs

1#[derive(Debug, thiserror::Error)]
2pub enum TokuError {
3    #[error("invalid book format: {0}")]
4    InvalidFormat(String),
5
6    #[error("invalid reading status: {0}")]
7    InvalidStatus(String),
8
9    #[error("invalid contributor role: {0}")]
10    InvalidRole(String),
11
12    #[error("invalid progress type: {0}")]
13    InvalidProgressType(String),
14
15    #[error("invalid duration format: {0}")]
16    InvalidDuration(String),
17
18    #[error("invalid tag type: {0}")]
19    InvalidTagType(String),
20
21    #[error("invalid pace rating: {0} (expected fast, medium, or slow)")]
22    InvalidPaceRating(String),
23
24    #[error("invalid ISBN: {0}")]
25    InvalidIsbn(String),
26
27    #[error("configuration error: {0}")]
28    Config(String),
29
30    #[error("invalid transition: cannot move from {from} to {to}")]
31    InvalidTransition {
32        from: &'static str,
33        to: &'static str,
34    },
35
36    #[error("work not found: {0}")]
37    WorkNotFound(String),
38
39    #[error("merge conflict: {0}")]
40    MergeConflict(String),
41
42    #[error("invalid filter: {0}")]
43    InvalidFilter(String),
44}