Skip to content

Commit b406caf

Browse files
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4b7e31d commit b406caf

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/hyperlight-js/src/sandbox/proto_js_sandbox.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,14 @@ impl ProtoJSSandbox {
149149
let module = host_modules
150150
.get(&module_name)
151151
.ok_or_else(|| new_error!("Host module '{}' not found", module_name))?;
152-
module.call(&func_name, args_json, Some(binaries))
152+
module
153+
.call(&func_name, args_json, Some(binaries))
154+
.map_err(|e| {
155+
e.context(format!(
156+
"Error calling host function '{}' in module '{}'",
157+
func_name, module_name
158+
))
159+
})
153160
},
154161
)?;
155162

src/js-host-api/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ unsafe fn json_to_napi_with_buffers(
686686
napi::sys::napi_create_string_utf8(
687687
env,
688688
key_bytes.as_ptr().cast(),
689-
key_bytes.len() as isize,
689+
key_bytes.len(),
690690
&mut key_val,
691691
)
692692
};

0 commit comments

Comments
 (0)