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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
use cometd::CometError;
pub type KahootResult<T> = Result<T, KahootError>;
#[derive(Debug, thiserror::Error)]
pub enum KahootError {
#[error("{0}")]
Hyper(#[from] hyper::Error),
#[error("{0}")]
InvalidUrl(#[from] http::uri::InvalidUri),
#[error("invalid http status {0}")]
InvalidStatus(http::StatusCode),
#[error("{0}")]
TokioJoin(#[from] tokio::task::JoinError),
#[error("{0}")]
Json(#[from] serde_json::Error),
#[error("{0}")]
Comet(#[from] CometError),
#[error("{0}")]
Http(#[from] http::Error),
#[error("{0}")]
ChallengeDecodeError(#[from] crate::challenge::DecodeError),
#[error("invalid game code")]
InvalidCode,
#[error("missing token")]
MissingToken,
#[error("missing name")]
MissingName,
#[error("invalid login")]
InvalidLogin(crate::LoginResponse),
}