diff --git a/rust/agama-transfer/src/handlers/yast.rs b/rust/agama-transfer/src/handlers/yast.rs index 956f9a9b89..74bd5b408a 100644 --- a/rust/agama-transfer/src/handlers/yast.rs +++ b/rust/agama-transfer/src/handlers/yast.rs @@ -39,7 +39,8 @@ impl HdHandler { }; let device_name = device_name.strip_prefix("/dev/").unwrap_or(&device_name); let device_url = format!("device://{}{}", &device_name, url.path()); - let device_url = Url::parse(&device_url)?; + let device_url = + Url::parse(&device_url).map_err(|e| Error::ParseError(device_url.to_string(), e))?; DeviceHandler::default().get(device_url, out_fd) } diff --git a/rust/agama-transfer/src/lib.rs b/rust/agama-transfer/src/lib.rs index c59de6a103..d2d130ac74 100644 --- a/rust/agama-transfer/src/lib.rs +++ b/rust/agama-transfer/src/lib.rs @@ -57,21 +57,21 @@ use handlers::{DeviceHandler, GenericHandler, HdHandler, LabelHandler}; pub enum Error { #[error("Could not retrieve the file")] CurlError(#[from] curl::Error), - #[error("Could not retrieve {0}")] + #[error("Could not retrieve '{0}'")] CurlTransferError(String, #[source] curl::Error), - #[error("Could not parse the URL")] - ParseError(#[from] url::ParseError), - #[error("File not found {0}")] + #[error("Could not parse the URL {0}")] + ParseError(String, #[source] url::ParseError), + #[error("File not found '{0}'")] FileNotFound(String), #[error("IO error: {0}")] IO(#[from] std::io::Error), #[error("Could not mount the file system {0}")] FileSystemMount(String), - #[error("Missing file path {0}")] + #[error("Missing file path '{0}'")] MissingPath(Url), - #[error("Missing device {0}")] + #[error("Missing device '{0}'")] MissingDevice(Url), - #[error("Missing file system label {0}")] + #[error("Missing file system label '{0}'")] MissingLabel(Url), } pub type TransferResult = Result; @@ -86,7 +86,7 @@ impl Transfer { /// * `out_fd`: where to write the data. /// * `insecure`: ignore SSL problems in HTTPS downloads. pub fn get(url: &str, out_fd: &mut impl Write, insecure: bool) -> TransferResult<()> { - let url = Url::parse(url)?; + let url = Url::parse(url).map_err(|e| Error::ParseError(url.to_string(), e))?; match url.scheme() { "device" | "usb" => DeviceHandler::default().get(url, out_fd), "label" => LabelHandler::default().get(url, out_fd), diff --git a/rust/package/agama.changes b/rust/package/agama.changes index 76ef5fd77b..8e6e7a32f0 100644 --- a/rust/package/agama.changes +++ b/rust/package/agama.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Feb 20 10:20:10 UTC 2026 - Imobach Gonzalez Sosa + +- Add the URL to the transfer errors (related to bsc#1258194). + ------------------------------------------------------------------- Fri Feb 20 09:35:01 UTC 2026 - Josef Reidinger