mirror of
https://github.com/timvisee/ffsend.git
synced 2025-10-03 09:39:15 +02:00
Print the path in file usage errors
This commit is contained in:
parent
8ae79c3e4f
commit
ae3bf27d0e
1 changed files with 6 additions and 5 deletions
|
@ -61,8 +61,9 @@ impl<'a> Download<'a> {
|
||||||
// Open the file we will write to
|
// Open the file we will write to
|
||||||
// TODO: this should become a temporary file first
|
// TODO: this should become a temporary file first
|
||||||
// TODO: use the uploaded file name as default
|
// TODO: use the uploaded file name as default
|
||||||
let out = File::create("downloaded.zip")
|
let path = "downloaded.zip";
|
||||||
.map_err(|err| Error::File(FileError::Create(err)))?;
|
let out = File::create(path)
|
||||||
|
.map_err(|err| Error::File(path.into(), FileError::Create(err)))?;
|
||||||
|
|
||||||
// Create the file reader for downloading
|
// Create the file reader for downloading
|
||||||
let (reader, len) = self.create_file_reader(&key, meta_nonce, &client)
|
let (reader, len) = self.create_file_reader(&key, meta_nonce, &client)
|
||||||
|
@ -74,7 +75,7 @@ impl<'a> Download<'a> {
|
||||||
len,
|
len,
|
||||||
&key,
|
&key,
|
||||||
reporter.clone(),
|
reporter.clone(),
|
||||||
).map_err(|err| Error::File(err))?;
|
).map_err(|err| Error::File(path.into(), err))?;
|
||||||
|
|
||||||
// Download the file
|
// Download the file
|
||||||
self.download(reader, writer, len, reporter)
|
self.download(reader, writer, len, reporter)
|
||||||
|
@ -361,8 +362,8 @@ pub enum Error {
|
||||||
|
|
||||||
/// An error occurred while opening or writing to the target file.
|
/// An error occurred while opening or writing to the target file.
|
||||||
// TODO: show what file this is about
|
// TODO: show what file this is about
|
||||||
#[fail(display = "Couldn't use the target file")]
|
#[fail(display = "Couldn't use the target file at '{}'", _0)]
|
||||||
File(#[cause] FileError),
|
File(String, #[cause] FileError),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<AuthError> for Error {
|
impl From<AuthError> for Error {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue