loadsmith_platform/
error.rs1use std::process::ExitStatus;
2
3#[derive(Debug, thiserror::Error)]
5pub enum Error {
6 #[error("I/O error")]
8 Io(#[from] std::io::Error),
9
10 #[error("JSON error")]
12 Json(#[from] serde_json::Error),
13
14 #[error("path is not valid UTF-8")]
16 Utf8(#[from] camino::FromPathBufError),
17
18 #[error("steamlocate error")]
20 SteamLocate(#[from] steamlocate::Error),
21
22 #[error("could not find app in steam library")]
24 SteamAppNotFound,
25
26 #[error("could not find steam executable")]
28 SteamExecutableNotFound,
29
30 #[error("Xbox Store query failed with status {status}")]
33 XboxStoreQueryFailed { status: ExitStatus },
34
35 #[error("Xbox Store query returned non-UTF-8 output")]
37 XboxNonUtf8 {
38 #[source]
39 source: std::string::FromUtf8Error,
40 },
41
42 #[error("game not found in Epic Games Launcher installations")]
44 EpicGameNotFound,
45
46 #[error("game path could not be determined and no override was provided")]
48 NoGamePathOverride,
49}
50
51pub type Result<T> = std::result::Result<T, Error>;