* [pbs-devel] [PATCH proxmox-backup v2] fix #3921: client: confusing backup reader error
@ 2023-12-15 12:34 Gabriel Goller
0 siblings, 0 replies; only message in thread
From: Gabriel Goller @ 2023-12-15 12:34 UTC (permalink / raw)
To: pbs-devel
When using the catalog shell command, a common error is that user pass
"./files.pxar" instead of "files.pxar". This will result in a cryptic error
"... value does not match regex pattern ...". Added some context to the
error according to suggestions here [1].
[1]: https://bugzilla.proxmox.com/show_bug.cgi?id=3921
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
Changes since v1:
- inlined variables in `format_err!` call
pbs-client/src/backup_reader.rs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pbs-client/src/backup_reader.rs b/pbs-client/src/backup_reader.rs
index 36d8ebcf..526b5bc6 100644
--- a/pbs-client/src/backup_reader.rs
+++ b/pbs-client/src/backup_reader.rs
@@ -98,7 +98,10 @@ impl BackupReader {
pub async fn download<W: Write + Send>(&self, file_name: &str, output: W) -> Result<(), Error> {
let path = "download";
let param = json!({ "file-name": file_name });
- self.h2.download(path, Some(param), output).await
+ self.h2
+ .download(path, Some(param), output)
+ .await
+ .map_err(|err| format_err!("http2 file download '{file_name}' failed: \n{err}"))
}
/// Execute a special GET request and send output to a writer
--
2.39.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-15 12:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-15 12:34 [pbs-devel] [PATCH proxmox-backup v2] fix #3921: client: confusing backup reader error Gabriel Goller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox