Skip to content

Commit

Permalink
feat!: [#488] return 503 instead of 500 when tracker is offline
Browse files Browse the repository at this point in the history
when the Index needs to make a request to the Tracker API and is not
available.
  • Loading branch information
josecelano committed Feb 23, 2024
1 parent d100b5b commit b8624a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ pub fn http_status_code_for_service_error(error: &ServiceError) -> StatusCode {
ServiceError::InfoHashAlreadyExists => StatusCode::BAD_REQUEST,
ServiceError::CanonicalInfoHashAlreadyExists => StatusCode::BAD_REQUEST,
ServiceError::TorrentTitleAlreadyExists => StatusCode::BAD_REQUEST,
ServiceError::TrackerOffline => StatusCode::INTERNAL_SERVER_ERROR,
ServiceError::TrackerOffline => StatusCode::SERVICE_UNAVAILABLE,
ServiceError::CategoryNameEmpty => StatusCode::BAD_REQUEST,
ServiceError::CategoryAlreadyExists => StatusCode::BAD_REQUEST,
ServiceError::TagNameEmpty => StatusCode::BAD_REQUEST,
Expand Down

0 comments on commit b8624a8

Please sign in to comment.