Merge remote-tracking branch 'origin/main' into search_combined

This commit is contained in:
Dessalines 2025-01-20 13:05:39 -05:00
commit 7e6ca820fc

View file

@ -242,14 +242,10 @@ cfg_if! {
impl actix_web::error::ResponseError for LemmyError {
fn status_code(&self) -> actix_web::http::StatusCode {
if self.error_type == LemmyErrorType::IncorrectLogin {
return actix_web::http::StatusCode::UNAUTHORIZED;
}
if self.error_type == LemmyErrorType::NotFound {
return actix_web::http::StatusCode::NOT_FOUND;
}
match self.inner.downcast_ref::<diesel::result::Error>() {
Some(diesel::result::Error::NotFound) => actix_web::http::StatusCode::NOT_FOUND,
match self.error_type {
LemmyErrorType::IncorrectLogin => actix_web::http::StatusCode::UNAUTHORIZED,
LemmyErrorType::NotFound => actix_web::http::StatusCode::NOT_FOUND,
LemmyErrorType::RateLimitError => actix_web::http::StatusCode::TOO_MANY_REQUESTS,
_ => actix_web::http::StatusCode::BAD_REQUEST,
}
}