mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 13:24:27 +01:00
Merge #1082
1082: remove maintenance error from http r=MarinPostma a=MarinPostma remove the maintenance error from `meilisearch-http` close #1061 Co-authored-by: mpostma <postma.marin@protonmail.com>
This commit is contained in:
commit
aab041e692
@ -69,7 +69,6 @@ pub enum Code {
|
|||||||
DocumentNotFound,
|
DocumentNotFound,
|
||||||
Internal,
|
Internal,
|
||||||
InvalidToken,
|
InvalidToken,
|
||||||
Maintenance,
|
|
||||||
MissingAuthorizationHeader,
|
MissingAuthorizationHeader,
|
||||||
NotFound,
|
NotFound,
|
||||||
PayloadTooLarge,
|
PayloadTooLarge,
|
||||||
@ -118,7 +117,6 @@ impl Code {
|
|||||||
DocumentNotFound => ErrCode::invalid("document_not_found", StatusCode::NOT_FOUND),
|
DocumentNotFound => ErrCode::invalid("document_not_found", StatusCode::NOT_FOUND),
|
||||||
Internal => ErrCode::internal("internal", StatusCode::INTERNAL_SERVER_ERROR),
|
Internal => ErrCode::internal("internal", StatusCode::INTERNAL_SERVER_ERROR),
|
||||||
InvalidToken => ErrCode::authentication("invalid_token", StatusCode::FORBIDDEN),
|
InvalidToken => ErrCode::authentication("invalid_token", StatusCode::FORBIDDEN),
|
||||||
Maintenance => ErrCode::internal("maintenance", StatusCode::SERVICE_UNAVAILABLE),
|
|
||||||
MissingAuthorizationHeader => ErrCode::authentication("missing_authorization_header", StatusCode::UNAUTHORIZED),
|
MissingAuthorizationHeader => ErrCode::authentication("missing_authorization_header", StatusCode::UNAUTHORIZED),
|
||||||
NotFound => ErrCode::invalid("not_found", StatusCode::NOT_FOUND),
|
NotFound => ErrCode::invalid("not_found", StatusCode::NOT_FOUND),
|
||||||
PayloadTooLarge => ErrCode::invalid("payload_too_large", StatusCode::PAYLOAD_TOO_LARGE),
|
PayloadTooLarge => ErrCode::invalid("payload_too_large", StatusCode::PAYLOAD_TOO_LARGE),
|
||||||
|
@ -90,7 +90,6 @@ pub enum Error {
|
|||||||
Internal(String),
|
Internal(String),
|
||||||
InvalidIndexUid,
|
InvalidIndexUid,
|
||||||
InvalidToken(String),
|
InvalidToken(String),
|
||||||
Maintenance,
|
|
||||||
MissingAuthorizationHeader,
|
MissingAuthorizationHeader,
|
||||||
NotFound(String),
|
NotFound(String),
|
||||||
OpenIndex(String),
|
OpenIndex(String),
|
||||||
@ -117,7 +116,6 @@ impl ErrorCode for Error {
|
|||||||
Internal(_) => Code::Internal,
|
Internal(_) => Code::Internal,
|
||||||
InvalidIndexUid => Code::InvalidIndexUid,
|
InvalidIndexUid => Code::InvalidIndexUid,
|
||||||
InvalidToken(_) => Code::InvalidToken,
|
InvalidToken(_) => Code::InvalidToken,
|
||||||
Maintenance => Code::Maintenance,
|
|
||||||
MissingAuthorizationHeader => Code::MissingAuthorizationHeader,
|
MissingAuthorizationHeader => Code::MissingAuthorizationHeader,
|
||||||
NotFound(_) => Code::NotFound,
|
NotFound(_) => Code::NotFound,
|
||||||
OpenIndex(_) => Code::OpenIndex,
|
OpenIndex(_) => Code::OpenIndex,
|
||||||
@ -218,10 +216,6 @@ impl Error {
|
|||||||
Error::InvalidIndexUid
|
Error::InvalidIndexUid
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn maintenance() -> Error {
|
|
||||||
Error::Maintenance
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn retrieve_document(doc_id: u32, err: impl fmt::Display) -> Error {
|
pub fn retrieve_document(doc_id: u32, err: impl fmt::Display) -> Error {
|
||||||
Error::RetrieveDocument(doc_id, err.to_string())
|
Error::RetrieveDocument(doc_id, err.to_string())
|
||||||
}
|
}
|
||||||
@ -251,7 +245,6 @@ impl fmt::Display for Error {
|
|||||||
Self::Internal(err) => f.write_str(err),
|
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::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::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::MissingAuthorizationHeader => f.write_str("You must have an authorization token"),
|
||||||
Self::NotFound(err) => write!(f, "{} not found", err),
|
Self::NotFound(err) => write!(f, "{} not found", err),
|
||||||
Self::OpenIndex(err) => write!(f, "Impossible to open index; {}", err),
|
Self::OpenIndex(err) => write!(f, "Impossible to open index; {}", err),
|
||||||
|
Loading…
Reference in New Issue
Block a user