unity_version/
error.rs

1use std::path::PathBuf;
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum VersionError {
6    #[error("Failed to parse unity version string: {0}")]
7    ParsingFailed(String),
8
9    #[error("Provided Path does not exist: {0}")]
10    PathContainsNoVersion(String),
11
12    #[error("Failed to parse unity version from path: {0}")]
13    FetchVersionFromPathFailed(PathBuf),
14
15    #[error("Executable at {0} contains no version information")]
16    ExecutableContainsNoVersion(PathBuf),
17
18    #[error("Unexpected error: {msg}")]
19    Other {
20        msg: String,
21        #[source]
22        source: anyhow::Error,
23    },
24}