1use std::io;
3
4use reqwest::blocking::Response;
5use thiserror::Error;
6
7use crate::tag::TagKind;
8
9#[derive(Error, Debug)]
11pub enum SteamConfigError {
12 #[error("Config to copy has no CompatToolMapping group")]
14 NoDefaultCompatToolAttribute,
15 #[error("IO error occurred - Inspect the source for more information")]
17 IoError {
18 #[from]
19 source: io::Error,
20 },
21}
22
23#[derive(Error, Debug)]
25pub enum LutrisConfigError {
26 #[error("Config to copy has no version attribute")]
28 NoVersionAttribute,
29 #[error("IO error occurred - Inspect the source for more information")]
31 IoError {
32 #[from]
33 source: io::Error,
34 },
35}
36
37#[derive(Error, Debug)]
39pub enum DeserializeError {
40 #[error("Could not convert Github JSON response into a struct")]
42 FailedToConvertToStruct {
43 #[from]
44 source: Box<dyn std::error::Error>,
45 },
46}
47
48#[derive(Debug, Error)]
50pub enum GithubError {
51 #[error("Failed to convert GitHub resource with serde")]
53 SerdeDeserializeError {
54 #[from]
55 source: serde_json::Error,
56 },
57 #[error("Failed to fetch resource from GitHub API")]
59 ReqwestError {
60 #[from]
61 source: reqwest::Error,
62 },
63 #[error("No tags could be found")]
65 NoTags,
66 #[error("For {tag} {kind} the release has no assets")]
68 ReleaseHasNoAssets { tag: String, kind: TagKind },
69 #[error("HTTP response status was not OK (200)")]
71 StatusNotOk(Response),
72}
73
74#[derive(Debug, Error)]
76pub enum TagKindError {
77 #[error("Could not create TagKind from provided string.")]
79 UnknownString,
80}