#[non_exhaustive]pub enum Error {
Show 30 variants
Io(Shared<Error>),
Http(Shared<Error>),
Json(Shared<Error>),
Zip(Shared<ZipError>),
Header(Shared<ToStrError>),
ParseInt(ParseIntError),
MissingHeader(String),
Config(String),
ManifestParse(String),
Cache(String),
SizeLimitExceeded {
context: String,
limit: u64,
actual: Option<u64>,
},
IncompleteDownload {
expected: u64,
actual: u64,
},
UnsafeName(String),
UnsupportedCacheVersion {
found: u32,
expected: u32,
},
Ecosystem(String),
Install(String),
Profile(String),
BadProfile(BadProfile),
NotInstalled {
package: String,
},
UnresolvedDependency {
package: String,
unresolved: Vec<String>,
},
MissingVersion {
package: String,
version: String,
},
UnknownGame {
game: String,
},
NoGameProfile {
game: String,
},
NoModLoader {
loader: LoaderKind,
},
MissingGameDir {
path: PathBuf,
},
Download {
total: usize,
failures: Vec<(String, Error)>,
},
ImportUnfinished {
failures: Vec<(String, Error)>,
},
InvalidHeader(String),
ExtractLimitExceeded(String),
ChecksumMismatch {
path: String,
expected: u32,
actual: u32,
},
}Expand description
Represents all possible errors that can occur within the Thunderstore engine.
This enum is #[non_exhaustive]: new variants may be added in future
releases without a breaking change, so downstream matches must include a
wildcard arm.
Error is Clone, so a client can keep one in its state or hand it to
several listeners. Sources that are not Clone themselves are held in a
Shared; ? still converts them directly, and
source still downcasts to them.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Shared<Error>)
Error from the IO system.
Http(Shared<Error>)
io only.Error from HTTP operations.
Json(Shared<Error>)
Error from JSON parsing.
Zip(Shared<ZipError>)
io only.Error from ZIP operations.
Header(Shared<ToStrError>)
io only.Error from header parsing.
ParseInt(ParseIntError)
Error from parsing integers.
MissingHeader(String)
Missing header in response.
Config(String)
Error from builder or configuration validation.
ManifestParse(String)
Error parsing a per-mod manifest.json.
Cache(String)
Error reading, writing, or validating the on-disk package-index cache.
Covers cache load/decode/encode, a missing cache, an incompatible or
corrupt cache layout, and the integrity checks in
PackageIndex::validate — which run at the
cache boundary.
SizeLimitExceeded
A network body, manifest file, or decompressed payload exceeded a configured size limit.
actual is a structured field for programmatic inspection; it is
deliberately not rendered in Display because thiserror cannot
conditionally format an Option.
Fields
IncompleteDownload
A download ended before the declared number of bytes arrived.
Fields
UnsafeName(String)
A download filename was unsafe (empty, absolute, or path-traversing).
UnsupportedCacheVersion
The on-disk cache was written by an incompatible version of the cache format. The client treats this as a cache miss and re-fetches.
Fields
Ecosystem(String)
Error from ecosystem-schema parsing.
Install(String)
Error from install routing, e.g. a package that would escape the install root.
Profile(String)
Error from the profile layer: an invalid profile name, a malformed
mods.yml/state file, or a profile operation that could not complete.
BadProfile(BadProfile)
A profile name that could not be used, from any operation that gates on
layout::require_profile.
Carries the reason rather than a sentence so an operation with other
failure modes, such as
layout::use_profile, can still
return one Error without a caller losing the ability to word the refusal
itself. Renders exactly as Error::Profile did for the same refusal.
NotInstalled
The package is not recorded in the target’s mods.yml.
UnresolvedDependency
A requested package, or a package in its dependency closure, is not in the package index, so nothing was installed.
Fields
MissingVersion
The index has the package, but not the version the request names.
UnknownGame
The ecosystem has no game with this slug.
NoGameProfile
The game is known, but the ecosystem gives it no profile, so there are no install rules to route its packages with.
NoModLoader
A modded launch found no mod loader installed in the target, so its mods would not load.
Fields
loader: LoaderKindThe loader the game’s mods need.
MissingGameDir
The game folder a launch needs does not exist.
Download
One or more files in a batch download failed.
Fields
ImportUnfinished
An import stopped because one or more of its mods failed to install, so its config files were not restored. Importing again once the causes are fixed skips the mods already installed and completes it.
InvalidHeader(String)
A response header was present but could not be parsed, e.g. an
unparseable Last-Modified value.
ExtractLimitExceeded(String)
An archive exceeded a configured extraction limit (entry count or uncompressed size), e.g. a zip bomb.
ChecksumMismatch
CRC32 verification failed while extracting an archive entry.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<BadProfile> for Error
impl From<BadProfile> for Error
Source§fn from(source: BadProfile) -> Self
fn from(source: BadProfile) -> Self
Source§impl From<NotRemovable> for Error
impl From<NotRemovable> for Error
Source§fn from(value: NotRemovable) -> Self
fn from(value: NotRemovable) -> Self
Source§impl From<ParseIntError> for Error
impl From<ParseIntError> for Error
Source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Source§impl From<ToStrError> for Error
Available on crate feature io only.
impl From<ToStrError> for Error
io only.