From a326466f32ff655e41c5100eb3f6c362f11ee662 Mon Sep 17 00:00:00 2001 From: mpostma Date: Mon, 16 Nov 2020 17:30:37 +0100 Subject: [PATCH 1/2] remove maintenance error from http --- meilisearch-http/src/error.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/meilisearch-http/src/error.rs b/meilisearch-http/src/error.rs index de3e82dac..e779c5708 100644 --- a/meilisearch-http/src/error.rs +++ b/meilisearch-http/src/error.rs @@ -90,7 +90,6 @@ pub enum Error { Internal(String), InvalidIndexUid, InvalidToken(String), - Maintenance, MissingAuthorizationHeader, NotFound(String), OpenIndex(String), @@ -117,7 +116,6 @@ impl ErrorCode for Error { Internal(_) => Code::Internal, InvalidIndexUid => Code::InvalidIndexUid, InvalidToken(_) => Code::InvalidToken, - Maintenance => Code::Maintenance, MissingAuthorizationHeader => Code::MissingAuthorizationHeader, NotFound(_) => Code::NotFound, OpenIndex(_) => Code::OpenIndex, @@ -218,10 +216,6 @@ impl Error { Error::InvalidIndexUid } - pub fn maintenance() -> Error { - Error::Maintenance - } - pub fn retrieve_document(doc_id: u32, err: impl fmt::Display) -> Error { Error::RetrieveDocument(doc_id, err.to_string()) } @@ -251,7 +245,6 @@ impl fmt::Display for Error { Self::Internal(err) => f.write_str(err), Self::InvalidIndexUid => f.write_str("Index must have a valid uid; Index uid can be of type integer or string only composed of alphanumeric characters, hyphens (-) and underscores (_)."), Self::InvalidToken(err) => write!(f, "Invalid API key: {}", err), - Self::Maintenance => f.write_str("Server is in maintenance, please try again later"), Self::MissingAuthorizationHeader => f.write_str("You must have an authorization token"), Self::NotFound(err) => write!(f, "{} not found", err), Self::OpenIndex(err) => write!(f, "Impossible to open index; {}", err), From 2eaab485321cf87d4a1fadd7fd77533935206cf7 Mon Sep 17 00:00:00 2001 From: mpostma Date: Thu, 19 Nov 2020 15:12:12 +0100 Subject: [PATCH 2/2] remove Maintenance error for error lib --- meilisearch-error/src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/meilisearch-error/src/lib.rs b/meilisearch-error/src/lib.rs index 0f86ff653..d0e00e9be 100644 --- a/meilisearch-error/src/lib.rs +++ b/meilisearch-error/src/lib.rs @@ -69,7 +69,6 @@ pub enum Code { DocumentNotFound, Internal, InvalidToken, - Maintenance, MissingAuthorizationHeader, NotFound, PayloadTooLarge, @@ -118,7 +117,6 @@ impl Code { DocumentNotFound => ErrCode::invalid("document_not_found", StatusCode::NOT_FOUND), Internal => ErrCode::internal("internal", StatusCode::INTERNAL_SERVER_ERROR), InvalidToken => ErrCode::authentication("invalid_token", StatusCode::FORBIDDEN), - Maintenance => ErrCode::internal("maintenance", StatusCode::SERVICE_UNAVAILABLE), MissingAuthorizationHeader => ErrCode::authentication("missing_authorization_header", StatusCode::UNAUTHORIZED), NotFound => ErrCode::invalid("not_found", StatusCode::NOT_FOUND), PayloadTooLarge => ErrCode::invalid("payload_too_large", StatusCode::PAYLOAD_TOO_LARGE),