feat: clearer error messages

This commit is contained in:
DecDuck
2025-12-19 14:36:40 +11:00
parent dac75556d3
commit 56e6ecee26
3 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -219,7 +219,7 @@ dependencies = [
[[package]]
name = "droplet-rs"
version = "0.12.2"
version = "0.12.3"
dependencies = [
"anyhow",
"async-trait",
+1 -1
View File
@@ -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"
+2 -3
View File
@@ -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?;