DownloadError: align Display with anyhow impl

This commit is contained in:
Joonas Koivunen
2023-09-06 17:10:11 +03:00
committed by Joonas Koivunen
parent c3a027b8b4
commit 45582a0ec4

View File

@@ -208,7 +208,14 @@ impl std::fmt::Display for DownloadError {
write!(f, "Failed to download a remote file due to user input: {e}")
}
DownloadError::NotFound => write!(f, "No file found for the remote object id given"),
DownloadError::Other(e) => write!(f, "Failed to download a remote file: {e:?}"),
DownloadError::Other(e) => {
write!(f, "Failed to download a remote file: ")?;
if f.alternate() {
write!(f, "{e:#}")
} else {
write!(f, "{e}")
}
}
}
}
}