From df8bfa26be69af46b8f166e255330b5ba8d48893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 15 Jan 2023 04:36:55 +0100 Subject: fix(napi): functions related to errors (#17370) This commits fixes various NAPI functions related to creation and throwing of errors. --- ext/napi/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/napi/lib.rs b/ext/napi/lib.rs index 22b0e3a08..1cb1b7c26 100644 --- a/ext/napi/lib.rs +++ b/ext/napi/lib.rs @@ -311,7 +311,7 @@ pub struct napi_extended_error_info { pub error_message: *const c_char, pub engine_reserved: *mut c_void, pub engine_error_code: i32, - pub status_code: napi_status, + pub error_code: napi_status, } #[repr(C)] @@ -416,6 +416,7 @@ pub struct Env { pub cleanup_hooks: Rc>>, pub tsfn_ref_counters: Rc>, + pub last_error: napi_extended_error_info, } unsafe impl Send for Env {} @@ -450,6 +451,12 @@ impl Env { threadsafe_function_sender, cleanup_hooks, tsfn_ref_counters, + last_error: napi_extended_error_info { + error_message: std::ptr::null(), + engine_reserved: std::ptr::null_mut(), + engine_error_code: 0, + error_code: napi_ok, + }, } } -- cgit v1.2.3