pub(super) fn fts_index_err(e: nodedb_fts::FtsIndexError<crate::Error>) -> crate::Error {
use nodedb_fts::FtsIndexError;
match e {
FtsIndexError::InvalidQuery(q) => crate::Error::BadRequest {
detail: q.to_string(),
},
FtsIndexError::Backend(inner) => inner,
other => crate::Error::Storage {
engine: "inverted".into(),
detail: other.to_string(),
},
}
}
pub(super) fn inverted_err(ctx: &str, e: impl std::fmt::Display) -> crate::Error {
crate::Error::Storage {
engine: "inverted".into(),
detail: format!("{ctx}: {e}"),
}
}
pub(super) fn into_result_err(e: crate::Error) -> crate::Error {
e
}