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
57
58
59
60
61
62
63
64
65
#[derive(thiserror::Error, Debug)]
pub enum ReShaderError {
#[error("Unable to fetch latest ReShade version: {0}")]
FetchLatestVersion(String),
#[error("Unable to download {0}: {1}")]
Download(String, String),
#[error("Could not symlink {0} to {1}: {2}")]
Symlink(String, String, String),
#[error("ReShade installer had no zip file")]
NoZipFile,
#[error("ReShade64.dll not found in ReShade installer")]
NoReShade64Dll,
#[error("Unable to read zip file")]
ReadZipFile,
#[error("Unable to extract zip file")]
ExtractZipFile,
#[error("Could not find repository for {0}")]
RepositoryNotFound(String),
#[error("Could not find branch {0} for repository {1}")]
BranchNotFound(String, String),
#[error("Merge conflicts found for branch {0} of repository {1}")]
MergeConflict(String, String),
#[error(transparent)]
Io(#[from] std::io::Error),
#[error(transparent)]
Reqwest(#[from] reqwest::Error),
#[error(transparent)]
Git(#[from] git2::Error),
}
impl From<ReShaderError> for inquire::InquireError {
fn from(value: ReShaderError) -> Self {
inquire::InquireError::Custom(Box::new(value))
}
}
pub type ReShaderResult<T> = std::result::Result<T, ReShaderError>;