You've already forked AstralRinth
forked from didirus/AstralRinth
Support for using a master key (#83)
* Support for using a master key * Expand scope of PR, add wrapper struct, add files to intitial versions/mods * Change changelog path, run formatter * Split file changes into different PR * Formatting, rename main variable Co-authored-by: Aeledfyr <aeledfyr@gmail.com>
This commit is contained in:
@@ -60,6 +60,8 @@ pub enum ApiError {
|
||||
JsonError(#[from] serde_json::Error),
|
||||
#[error("Authentication Error")]
|
||||
AuthenticationError,
|
||||
#[error("Search Error: {0}")]
|
||||
SearchError(#[from] meilisearch_sdk::errors::Error),
|
||||
}
|
||||
|
||||
impl actix_web::ResponseError for ApiError {
|
||||
@@ -68,6 +70,7 @@ impl actix_web::ResponseError for ApiError {
|
||||
ApiError::DatabaseError(..) => actix_web::http::StatusCode::INTERNAL_SERVER_ERROR,
|
||||
ApiError::AuthenticationError => actix_web::http::StatusCode::UNAUTHORIZED,
|
||||
ApiError::JsonError(..) => actix_web::http::StatusCode::BAD_REQUEST,
|
||||
ApiError::SearchError(..) => actix_web::http::StatusCode::INTERNAL_SERVER_ERROR,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +81,7 @@ impl actix_web::ResponseError for ApiError {
|
||||
ApiError::DatabaseError(..) => "database_error",
|
||||
ApiError::AuthenticationError => "unauthorized",
|
||||
ApiError::JsonError(..) => "json_error",
|
||||
ApiError::SearchError(..) => "search_error",
|
||||
},
|
||||
description: &self.to_string(),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user