6e7b96cd66
- Move fetch_plugin from finalize::plugin::fetch to utils::fetch_plugin - Delete unused crates: workshop-cert, workshop-deviceid, workshop-vault - Remove parser benchmarks and empty daemon/socket modules - Add new workshop-getterurl crate for resource fetching
46 lines
1.2 KiB
Rust
46 lines
1.2 KiB
Rust
use thiserror::Error;
|
|
|
|
/// Error during URL parsing.
|
|
#[derive(Error, Debug)]
|
|
pub enum ParseError {
|
|
#[error("invalid URL: {0}")]
|
|
InvalidUrl(#[from] url::ParseError),
|
|
|
|
#[error("missing '::' separator in forced getter URL")]
|
|
MissingSeparator,
|
|
|
|
#[error("unknown getter type: '{0}'")]
|
|
UnknownGetter(String),
|
|
}
|
|
|
|
/// Error during resource fetching.
|
|
#[derive(Error, Debug)]
|
|
pub enum GetterError {
|
|
#[error("getter '{name}' not found in registry")]
|
|
UnknownGetter { name: String },
|
|
|
|
#[error("HTTP request failed for '{url}': {reason}")]
|
|
HttpError { url: String, reason: String },
|
|
|
|
#[error("HTTP status {status} for '{url}'")]
|
|
HttpStatus { url: String, status: u16 },
|
|
|
|
#[error("git clone failed for '{url}': {reason}")]
|
|
GitError { url: String, reason: String },
|
|
|
|
#[error("git checkout failed for ref '{git_ref}': {reason}")]
|
|
GitCheckoutError { git_ref: String, reason: String },
|
|
|
|
#[error("file not found: {0}")]
|
|
FileNotFound(String),
|
|
|
|
#[error("checksum mismatch: expected '{expected}', got '{actual}'")]
|
|
ChecksumMismatch { expected: String, actual: String },
|
|
|
|
#[error("IO error: {0}")]
|
|
Io(#[from] std::io::Error),
|
|
|
|
#[error("{0}")]
|
|
General(String),
|
|
}
|