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
40 lines (28 loc) · 860 Bytes
/
Copy patherrors.rs
File metadata and controls
40 lines (28 loc) · 860 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
32
33
34
35
36
37
38
39
40
use thiserror::Error;
#[derive(Error, Debug)]
pub enum ServerError {
#[error("internal server error")]
InternalServerError,
#[error("info_hash is either missing or invalid")]
InvalidInfoHash,
#[error("connection id could not be verified")]
InvalidConnectionId,
#[error("connection id expired")]
ExpiredConnectionId,
#[error("connection bad witness")]
BadWitnessConnectionId,
#[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,
#[error("bad request")]
BadRequest,
}