From 3bd5a90976250085f001ef78d674ea149ed33ad9 Mon Sep 17 00:00:00 2001 From: mpostma Date: Fri, 29 May 2020 16:29:46 +0200 Subject: [PATCH] rename error types --- meilisearch-error/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meilisearch-error/src/lib.rs b/meilisearch-error/src/lib.rs index c0dec6a3e..d9537a9bc 100644 --- a/meilisearch-error/src/lib.rs +++ b/meilisearch-error/src/lib.rs @@ -28,8 +28,8 @@ pub trait ErrorCode: std::error::Error { enum ErrorType { InternalError, - InvalidRequest, - Authentication, + InvalidRequestError, + AuthenticationError, } impl fmt::Display for ErrorType { @@ -38,8 +38,8 @@ impl fmt::Display for ErrorType { match self { InternalError => write!(f, "internal_error"), - InvalidRequest => write!(f, "invalid_request"), - Authentication => write!(f, "authentication"), + InvalidRequestError => write!(f, "invalid_request_error"), + AuthenticationError => write!(f, "authentication_error"), } } } @@ -152,7 +152,7 @@ impl ErrCode { ErrCode { status_code, error_name, - error_type: ErrorType::Authentication, + error_type: ErrorType::AuthenticationError, } } @@ -168,7 +168,7 @@ impl ErrCode { ErrCode { status_code, error_name, - error_type: ErrorType::InvalidRequest, + error_type: ErrorType::InvalidRequestError, } } }