1use std::path::PathBuf;
4use thiserror::Error;
5
6pub type Result<T, E = Error> = std::result::Result<T, E>;
8
9#[derive(Debug, Error)]
11#[non_exhaustive]
12pub enum Error {
13 #[error("failed to bind HTTP listener on {addr}: {source}")]
15 Bind {
16 addr: String,
18 #[source]
20 source: std::io::Error,
21 },
22
23 #[error("io error: {0}")]
25 Io(#[from] std::io::Error),
26
27 #[error("failed to parse GSI payload: {0}")]
29 Parse(#[from] serde_json::Error),
30
31 #[error("could not locate Counter-Strike 2 installation: {0}")]
33 SteamDiscovery(String),
34
35 #[error("failed to write GSI cfg file at {path}: {source}")]
37 CfgWrite {
38 path: PathBuf,
40 #[source]
42 source: std::io::Error,
43 },
44
45 #[error("listener has already been started")]
47 AlreadyStarted,
48
49 #[error("listener is not running")]
51 NotRunning,
52}