Skip to content

Commit b8624a8

Browse files
committed
feat!: [#488] return 503 instead of 500 when tracker is offline
when the Index needs to make a request to the Tracker API and is not available.
1 parent d100b5b commit b8624a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ pub fn http_status_code_for_service_error(error: &ServiceError) -> StatusCode {
298298
ServiceError::InfoHashAlreadyExists => StatusCode::BAD_REQUEST,
299299
ServiceError::CanonicalInfoHashAlreadyExists => StatusCode::BAD_REQUEST,
300300
ServiceError::TorrentTitleAlreadyExists => StatusCode::BAD_REQUEST,
301-
ServiceError::TrackerOffline => StatusCode::INTERNAL_SERVER_ERROR,
301+
ServiceError::TrackerOffline => StatusCode::SERVICE_UNAVAILABLE,
302302
ServiceError::CategoryNameEmpty => StatusCode::BAD_REQUEST,
303303
ServiceError::CategoryAlreadyExists => StatusCode::BAD_REQUEST,
304304
ServiceError::TagNameEmpty => StatusCode::BAD_REQUEST,

0 commit comments

Comments
 (0)