2022-09-07 05:49:19 +08:00
|
|
|
use milli::heed;
|
2022-09-06 22:43:59 +08:00
|
|
|
use thiserror::Error;
|
|
|
|
|
2022-09-08 02:30:33 +08:00
|
|
|
use crate::index;
|
|
|
|
|
2022-09-06 22:43:59 +08:00
|
|
|
#[derive(Error, Debug)]
|
|
|
|
pub enum Error {
|
2022-09-08 02:08:07 +08:00
|
|
|
#[error("Index `{}` not found", .0)]
|
|
|
|
IndexNotFound(String),
|
|
|
|
#[error("Index `{}` already exists", .0)]
|
|
|
|
IndexAlreadyExists(String),
|
2022-09-07 05:49:19 +08:00
|
|
|
#[error("Corrupted task queue.")]
|
|
|
|
CorruptedTaskQueue,
|
|
|
|
#[error(transparent)]
|
|
|
|
Heed(#[from] heed::Error),
|
|
|
|
#[error(transparent)]
|
|
|
|
Milli(#[from] milli::Error),
|
2022-09-08 02:30:33 +08:00
|
|
|
#[error("{0}")]
|
|
|
|
IndexError(#[from] index::error::IndexError),
|
2022-09-07 05:49:19 +08:00
|
|
|
|
|
|
|
#[error(transparent)]
|
|
|
|
Anyhow(#[from] anyhow::Error),
|
2022-09-06 22:43:59 +08:00
|
|
|
}
|