Skip to content

Commit a61c5a5

Browse files
committed
Return underlying error from node module
1 parent e78404d commit a61c5a5

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

desktop/packages/windows-utils/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ neon = "1"
2020
windows = { version = "0.59.0", features = ["Win32", "Win32_UI", "Win32_UI_Shell", "Win32_System", "Win32_System_Com", "Win32_Storage_FileSystem"] }
2121
thiserror = { workspace = true }
2222

23+
talpid-types = { path = "../../../talpid-types" }
2324
talpid-windows = { path = "../../../talpid-windows" }

desktop/packages/windows-utils/windows-utils-rs/fs.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use neon::prelude::{Context, FunctionContext};
55
use neon::result::JsResult;
66
use neon::types::{JsString, JsValue, Value};
77

8+
use talpid_types::ErrorExt;
9+
810
#[derive(thiserror::Error, Debug)]
911
enum Error {
1012
/// Failed to open the provided file
@@ -21,7 +23,7 @@ pub fn pipe_is_admin_owned(mut cx: FunctionContext<'_>) -> JsResult<'_, JsValue>
2123

2224
match pipe_is_admin_owned_inner(link_path) {
2325
Ok(is_admin_owned) => Ok(cx.boolean(is_admin_owned).as_value(&mut cx)),
24-
Err(err) => cx.throw_error(format!("Failed to get pipe ownership: {err}")),
26+
Err(err) => cx.throw_error(err.display_chain()),
2527
}
2628
}
2729

0 commit comments

Comments
 (0)