1use thiserror::Error;
2
3#[derive(Error, Debug)]
5pub enum IndexError {
6 #[error("bucket duration must not be zero")]
8 ZeroBucketDuration,
9
10 #[error("cannot create histogram from empty input")]
12 EmptyHistogramInput,
13
14 #[error("invalid query time range")]
16 InvalidQueryTimeRange,
17
18 #[error("invalid regex pattern:")]
20 InvalidRegex,
21
22 #[error("invalid field prefix")]
24 InvalidFieldPrefix,
25
26 #[error("non-utf8 payload")]
28 NonUtf8Payload,
29
30 #[error("non-integer payload")]
32 NonIntegerPayload,
33
34 #[error("missing field name")]
36 MissingFieldName,
37
38 #[error("missing required offset in journal file")]
40 MissingOffset,
41
42 #[error("journal error: {0}")]
44 Journal(#[from] journal_core::error::JournalError),
45}
46
47static_assertions::const_assert!(std::mem::size_of::<IndexError>() <= 32);
48
49pub type Result<T> = std::result::Result<T, IndexError>;