feat: clearer error messages
This commit is contained in:
Generated
+1
-1
@@ -219,7 +219,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "droplet-rs"
|
||||
version = "0.12.2"
|
||||
version = "0.12.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
edition = "2021"
|
||||
authors = ["Drop-OSS"]
|
||||
name = "droplet-rs"
|
||||
version = "0.12.2"
|
||||
version = "0.12.3"
|
||||
license = "AGPL-3.0-only"
|
||||
description = "Droplet is a `napi.rs` Rust/Node.js package full of high-performance and low-level utils for Drop"
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ use tokio::{
|
||||
io::{AsyncReadExt as _, AsyncSeekExt as _, BufReader},
|
||||
process::Command,
|
||||
};
|
||||
use x509_parser::nom::InputIter;
|
||||
|
||||
use crate::versions::types::{MinimumFileObject, VersionBackend, VersionFile};
|
||||
|
||||
@@ -55,7 +54,7 @@ impl VersionBackend for PathVersionBackend {
|
||||
self.peek_file(
|
||||
relative
|
||||
.to_str()
|
||||
.ok_or(anyhow!("Could not parse path"))?
|
||||
.ok_or(anyhow!("Could not parse path: {}", relative.to_string_lossy()))?
|
||||
.to_owned(),
|
||||
)
|
||||
.await?,
|
||||
@@ -87,7 +86,7 @@ impl VersionBackend for PathVersionBackend {
|
||||
async fn peek_file(&mut self, sub_path: String) -> anyhow::Result<VersionFile> {
|
||||
let pathbuf = self.base_dir.join(sub_path.clone());
|
||||
if !pathbuf.exists() {
|
||||
return Err(anyhow!("Path doesn't exist."));
|
||||
return Err(anyhow!("Path doesn't exist: {}", pathbuf.to_string_lossy()));
|
||||
};
|
||||
|
||||
let file = File::open(pathbuf.clone()).await?;
|
||||
|
||||
Reference in New Issue
Block a user