forked from torrust/torrust-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.rs
More file actions
31 lines (22 loc) · 663 Bytes
/
errors.rs
File metadata and controls
31 lines (22 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use warp::reject::Reject;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum ServerError {
#[error("internal server error")]
InternalServerError,
#[error("info_hash is either missing or invalid")]
InvalidInfoHash,
#[error("could not find remote address")]
AddressNotFound,
#[error("torrent has no peers")]
NoPeersFound,
#[error("torrent not on whitelist")]
TorrentNotWhitelisted,
#[error("peer not authenticated")]
PeerNotAuthenticated,
#[error("invalid authentication key")]
PeerKeyNotValid,
#[error("exceeded info_hash limit")]
ExceededInfoHashLimit,
}
impl Reject for ServerError {}