1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum VersionError {
5 #[error("Invalid version string: {0}")]
6 InvalidVersionString(String),
7
8 #[error("Invalid version")]
9 InvalidVersion(#[source] semver::Error),
10
11 #[error("Invalid pre release identifier")]
12 InvalidPreReleaseIdentifier(#[source] semver::Error),
13
14 #[error("Version string is empty")]
15 EmptyVersionString,
16
17 #[error("Invalid version parse error")]
18 ParseError(#[source] core::num::ParseIntError),
19
20 #[error("Invalid version provided with * syntax")]
21 StarSyntaxError,
22
23 #[error("Invalid version provided with ^ syntax")]
24 CaretSyntaxError,
25
26 #[error("Invalid version provided with exact syntax")]
27 ExactSyntaxError,
28}