refactor errors / isolate core/http errors

This commit is contained in:
mpostma 2020-05-22 12:03:57 +02:00
parent e2db197b3f
commit d69180ec67
29 changed files with 585 additions and 480 deletions

View file

@ -8,6 +8,7 @@ edition = "2018"
[dependencies]
bincode = "1.2.1"
indexmap = { version = "1.3.2", features = ["serde-1"] }
meilisearch-error = { path = "../meilisearch-error", version = "0.10.1" }
serde = { version = "1.0.105", features = ["derive"] }
serde_json = { version = "1.0.50", features = ["preserve_order"] }
toml = { version = "0.5.6", features = ["preserve_order"] }

View file

@ -1,6 +1,7 @@
use std::{error, fmt};
use meilisearch_error::{ErrorCode, Code};
pub type SResult<T> = Result<T, Error>;
#[derive(Debug)]
@ -22,3 +23,9 @@ impl fmt::Display for Error {
}
impl error::Error for Error {}
impl ErrorCode for Error {
fn error_code(&self) -> Code {
unimplemented!()
}
}