mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-30 00:34:26 +01:00
rename error types
This commit is contained in:
parent
68ad570cfc
commit
3bd5a90976
@ -28,8 +28,8 @@ pub trait ErrorCode: std::error::Error {
|
|||||||
|
|
||||||
enum ErrorType {
|
enum ErrorType {
|
||||||
InternalError,
|
InternalError,
|
||||||
InvalidRequest,
|
InvalidRequestError,
|
||||||
Authentication,
|
AuthenticationError,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for ErrorType {
|
impl fmt::Display for ErrorType {
|
||||||
@ -38,8 +38,8 @@ impl fmt::Display for ErrorType {
|
|||||||
|
|
||||||
match self {
|
match self {
|
||||||
InternalError => write!(f, "internal_error"),
|
InternalError => write!(f, "internal_error"),
|
||||||
InvalidRequest => write!(f, "invalid_request"),
|
InvalidRequestError => write!(f, "invalid_request_error"),
|
||||||
Authentication => write!(f, "authentication"),
|
AuthenticationError => write!(f, "authentication_error"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -152,7 +152,7 @@ impl ErrCode {
|
|||||||
ErrCode {
|
ErrCode {
|
||||||
status_code,
|
status_code,
|
||||||
error_name,
|
error_name,
|
||||||
error_type: ErrorType::Authentication,
|
error_type: ErrorType::AuthenticationError,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ impl ErrCode {
|
|||||||
ErrCode {
|
ErrCode {
|
||||||
status_code,
|
status_code,
|
||||||
error_name,
|
error_name,
|
||||||
error_type: ErrorType::InvalidRequest,
|
error_type: ErrorType::InvalidRequestError,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user