mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-25 22:34:28 +01:00
remove an unused error handling file
This commit is contained in:
parent
d8fb506c92
commit
52aa34d984
@ -19,9 +19,9 @@ pub enum Error {
|
|||||||
impl ErrorCode for Error {
|
impl ErrorCode for Error {
|
||||||
fn error_code(&self) -> Code {
|
fn error_code(&self) -> Code {
|
||||||
match self {
|
match self {
|
||||||
// Are these three really Internal errors?
|
Error::Io(e) => e.error_code(),
|
||||||
// TODO look at that later.
|
|
||||||
Error::Io(_) => Code::Internal,
|
// These error come from an internal mis
|
||||||
Error::Serde(_) => Code::Internal,
|
Error::Serde(_) => Code::Internal,
|
||||||
Error::Uuid(_) => Code::Internal,
|
Error::Uuid(_) => Code::Internal,
|
||||||
|
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
use meilisearch_auth::error::AuthControllerError;
|
|
||||||
use meilisearch_types::error::{Code, ErrorCode};
|
|
||||||
use meilisearch_types::internal_error;
|
|
||||||
|
|
||||||
use crate::{index_resolver::error::IndexResolverError, tasks::error::TaskError};
|
|
||||||
|
|
||||||
pub type Result<T> = std::result::Result<T, DumpError>;
|
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
|
||||||
pub enum DumpError {
|
|
||||||
#[error("An internal error has occurred. `{0}`.")]
|
|
||||||
Internal(Box<dyn std::error::Error + Send + Sync + 'static>),
|
|
||||||
#[error("{0}")]
|
|
||||||
IndexResolver(Box<IndexResolverError>),
|
|
||||||
}
|
|
||||||
|
|
||||||
internal_error!(
|
|
||||||
DumpError: milli::heed::Error,
|
|
||||||
std::io::Error,
|
|
||||||
tokio::task::JoinError,
|
|
||||||
tokio::sync::oneshot::error::RecvError,
|
|
||||||
serde_json::error::Error,
|
|
||||||
tempfile::PersistError,
|
|
||||||
fs_extra::error::Error,
|
|
||||||
AuthControllerError,
|
|
||||||
TaskError
|
|
||||||
);
|
|
||||||
|
|
||||||
impl From<IndexResolverError> for DumpError {
|
|
||||||
fn from(e: IndexResolverError) -> Self {
|
|
||||||
Self::IndexResolver(Box::new(e))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ErrorCode for DumpError {
|
|
||||||
fn error_code(&self) -> Code {
|
|
||||||
match self {
|
|
||||||
DumpError::Internal(_) => Code::Internal,
|
|
||||||
DumpError::IndexResolver(e) => e.error_code(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -462,8 +462,7 @@ impl ErrorCode for io::Error {
|
|||||||
Some(5) => Code::IoError,
|
Some(5) => Code::IoError,
|
||||||
Some(24) => Code::TooManyOpenFiles,
|
Some(24) => Code::TooManyOpenFiles,
|
||||||
Some(28) => Code::NoSpaceLeftOnDevice,
|
Some(28) => Code::NoSpaceLeftOnDevice,
|
||||||
e => todo!("missed something asshole {:?}", e),
|
_ => Code::Internal,
|
||||||
// e => Code::Internal,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user