use thiserror::Error;
#[derive(Error, Debug)]
pub enum IndexError {
#[error("bucket duration must not be zero")]
ZeroBucketDuration,
#[error("cannot create histogram from empty input")]
EmptyHistogramInput,
#[error("invalid query time range")]
InvalidQueryTimeRange,
#[error("invalid regex pattern:")]
InvalidRegex,
#[error("invalid field prefix")]
InvalidFieldPrefix,
#[error("non-utf8 payload")]
NonUtf8Payload,
#[error("non-integer payload")]
NonIntegerPayload,
#[error("missing field name")]
MissingFieldName,
#[error("missing required offset in journal file")]
MissingOffset,
#[error("journal error: {0}")]
Journal(#[from] journal_core::error::JournalError),
}
static_assertions::const_assert!(std::mem::size_of::<IndexError>() <= 32);
pub type Result<T> = std::result::Result<T, IndexError>;