Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion rust/agama-transfer/src/handlers/yast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
16 changes: 8 additions & 8 deletions rust/agama-transfer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> = Result<T, Error>;
Expand All @@ -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),
Expand Down
5 changes: 5 additions & 0 deletions rust/package/agama.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Feb 20 10:20:10 UTC 2026 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Add the URL to the transfer errors (related to bsc#1258194).

-------------------------------------------------------------------
Fri Feb 20 09:35:01 UTC 2026 - Josef Reidinger <jreidinger@suse.com>

Expand Down
Loading