reintroduce anyhow

This commit is contained in:
marin postma 2021-06-15 17:39:07 +02:00
parent 439db1aae0
commit 02277ec2cf
No known key found for this signature in database
GPG key ID: 6088B7721C3E39F9
36 changed files with 110 additions and 154 deletions

View file

@ -27,12 +27,7 @@ macro_rules! internal_error {
}
}
internal_error!(
std::io::Error,
heed::Error,
fst::Error,
serde_json::Error
);
internal_error!(std::io::Error, heed::Error, fst::Error, serde_json::Error);
impl ErrorCode for IndexError {
fn error_code(&self) -> Code {
@ -47,14 +42,13 @@ impl ErrorCode for IndexError {
#[derive(Debug, thiserror::Error)]
pub enum FacetError {
#[error("Invalid facet expression, expected {}, found: {1}", .0.join(", "))]
InvalidExpression(&'static [&'static str], Value)
InvalidExpression(&'static [&'static str], Value),
}
impl ErrorCode for FacetError {
impl ErrorCode for FacetError {
fn error_code(&self) -> Code {
match self {
FacetError::InvalidExpression(_, _) => Code::Facet,
}
}
}