Skip to content

Commit d7902f1

Browse files
committed
refactor: [torrust#1456] remove unused enum variant in udp server error
1 parent 8f3c22a commit d7902f1

File tree

5 files changed

+1
-10
lines changed

5 files changed

+1
-10
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/udp-tracker-server/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ torrust-server-lib = { version = "3.0.0-develop", path = "../server-lib" }
3030
torrust-tracker-clock = { version = "3.0.0-develop", path = "../clock" }
3131
torrust-tracker-configuration = { version = "3.0.0-develop", path = "../configuration" }
3232
torrust-tracker-events = { version = "3.0.0-develop", path = "../events" }
33-
torrust-tracker-located-error = { version = "3.0.0-develop", path = "../located-error" }
3433
torrust-tracker-metrics = { version = "3.0.0-develop", path = "../metrics" }
3534
torrust-tracker-primitives = { version = "3.0.0-develop", path = "../primitives" }
3635
torrust-tracker-swarm-coordination-registry = { version = "3.0.0-develop", path = "../swarm-coordination-registry" }

packages/udp-tracker-server/src/error.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use bittorrent_udp_tracker_core::services::announce::UdpAnnounceError;
77
use bittorrent_udp_tracker_core::services::scrape::UdpScrapeError;
88
use derive_more::derive::Display;
99
use thiserror::Error;
10-
use torrust_tracker_located_error::LocatedError;
1110

1211
#[derive(Display, Debug)]
1312
#[display(":?")]
@@ -35,12 +34,6 @@ pub enum Error {
3534
message: String,
3635
},
3736

38-
/// Error returned when the request is invalid.
39-
#[error("bad request: {source}")]
40-
BadRequest {
41-
source: LocatedError<'static, dyn std::error::Error + Send + Sync>,
42-
},
43-
4437
/// Error returned when tracker requires authentication.
4538
#[error("domain tracker requires authentication but is not supported in current UDP implementation. Location: {location}")]
4639
TrackerAuthenticationRequired { location: &'static Location<'static> },

packages/udp-tracker-server/src/event.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ impl From<Error> for ErrorKind {
146146
UdpScrapeError::TrackerCoreWhitelistError { source } => Self::Whitelist(source.to_string()),
147147
},
148148
Error::InternalServer { location: _, message } => Self::InternalServer(message.to_string()),
149-
Error::BadRequest { source } => Self::BadRequest(source.to_string()),
150149
Error::TrackerAuthenticationRequired { location } => Self::TrackerAuthentication(location.to_string()),
151150
}
152151
}

packages/udp-tracker-server/src/handlers/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ pub(crate) async fn handle_packet(
109109
}
110110
},
111111
Err(e) => {
112+
// The request payload could not be parsed, so we handle it as an error.
112113
let response = handle_error(
113114
None,
114115
udp_request.from,

0 commit comments

Comments
 (0)