1use nym_validator_client::nym_api::error::NymAPIError;
5use nym_validator_client::nyxd::error::NyxdError;
6use std::net::SocketAddr;
7
8#[derive(thiserror::Error, Debug)]
10pub enum SessionError {
11 #[error("nyxd chain client error: {0}")]
13 Nyxd(#[from] NyxdError),
14
15 #[error("nym-api error: {0}")]
17 Api(#[from] NymAPIError),
18
19 #[error("network details contain no usable {which} endpoint")]
21 MissingEndpoint { which: &'static str },
22
23 #[error("invalid {which} url {url}: {source}")]
25 InvalidUrl {
26 which: &'static str,
27 url: String,
28 #[source]
29 source: url::ParseError,
30 },
31
32 #[error("credential storage error: {0}")]
34 Storage(String),
35
36 #[error("ticketbook issuance error: {0}")]
38 Issuance(String),
39
40 #[error(
44 "provisioning timed out after {after:?} — the ecash signers are likely unresponsive; \
45 any deposit already made is recoverable from the pending-request store on retry"
46 )]
47 ProvisioningTimeout { after: std::time::Duration },
48
49 #[error("no gateway found with identity {0}")]
51 GatewayNotFound(String),
52
53 #[error("no WireGuard-capable gateway available for the requested role")]
55 NoWireguardGateway,
56
57 #[error("no WireGuard-capable gateway found in country {0}")]
59 NoCountryMatch(String),
60
61 #[error("no QUIC-bridge gateway available for selection: {spec}")]
64 NoQuicGateway { spec: String },
65
66 #[error("entry and exit resolved to the same gateway ({0}); a two-hop tunnel needs distinct gateways")]
67 SameGatewaySelected(String),
68
69 #[error("gateway {identity} advertised malformed LP data: {reason}")]
71 MalformedGateway { identity: String, reason: String },
72
73 #[error("registration with gateway at {address} failed: {source}")]
75 Registration {
76 address: SocketAddr,
77 #[source]
78 source: nym_registration_client::LpClientError,
79 },
80
81 #[error("session setup was cancelled")]
83 Cancelled,
84}