mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-06 03:06:04 +00:00
fix: use correct response for NoEffect errors (#732)
Signed-off-by: ispik <ispik@ispik.dev>
This commit is contained in:
@@ -36,9 +36,7 @@ impl IntoResponse for Error {
|
||||
ErrorType::NotInGroup => StatusCode::NOT_FOUND,
|
||||
ErrorType::AlreadyPinned => StatusCode::BAD_REQUEST,
|
||||
ErrorType::NotPinned => StatusCode::BAD_REQUEST,
|
||||
ErrorType::InSlowmode {
|
||||
retry_after: _,
|
||||
} => StatusCode::TOO_MANY_REQUESTS,
|
||||
ErrorType::InSlowmode { retry_after: _ } => StatusCode::TOO_MANY_REQUESTS,
|
||||
|
||||
ErrorType::CantCreateServers => StatusCode::FORBIDDEN,
|
||||
ErrorType::UnknownServer => StatusCode::NOT_FOUND,
|
||||
@@ -78,7 +76,7 @@ impl IntoResponse for Error {
|
||||
ErrorType::DuplicateNonce => StatusCode::CONFLICT,
|
||||
ErrorType::VosoUnavailable => StatusCode::BAD_REQUEST,
|
||||
ErrorType::NotFound => StatusCode::NOT_FOUND,
|
||||
ErrorType::NoEffect => StatusCode::OK,
|
||||
ErrorType::NoEffect => StatusCode::BAD_REQUEST,
|
||||
ErrorType::FailedValidation { .. } => StatusCode::BAD_REQUEST,
|
||||
ErrorType::LiveKitUnavailable => StatusCode::BAD_REQUEST,
|
||||
ErrorType::NotConnected => StatusCode::BAD_REQUEST,
|
||||
|
||||
@@ -42,9 +42,7 @@ impl<'r> Responder<'r, 'static> for Error {
|
||||
ErrorType::NotInGroup => Status::NotFound,
|
||||
ErrorType::AlreadyPinned => Status::BadRequest,
|
||||
ErrorType::NotPinned => Status::BadRequest,
|
||||
ErrorType::InSlowmode {
|
||||
retry_after: _,
|
||||
} => Status::TooManyRequests,
|
||||
ErrorType::InSlowmode { retry_after: _ } => Status::TooManyRequests,
|
||||
ErrorType::InvalidFlagValue => Status::BadRequest,
|
||||
|
||||
ErrorType::CantCreateServers => Status::Forbidden,
|
||||
@@ -84,7 +82,7 @@ impl<'r> Responder<'r, 'static> for Error {
|
||||
ErrorType::NotAuthenticated => Status::Unauthorized,
|
||||
ErrorType::DuplicateNonce => Status::Conflict,
|
||||
ErrorType::NotFound => Status::NotFound,
|
||||
ErrorType::NoEffect => Status::Ok,
|
||||
ErrorType::NoEffect => Status::BadRequest,
|
||||
ErrorType::FailedValidation { .. } => Status::BadRequest,
|
||||
ErrorType::LiveKitUnavailable => Status::BadRequest,
|
||||
ErrorType::NotAVoiceChannel => Status::BadRequest,
|
||||
|
||||
Reference in New Issue
Block a user