Skip to content

Commit 8e23b9d

Browse files
committed
fix: enhance error handling in NAPI_THROW_LAST_ERROR macro for improved clarity
1 parent 6f03a5d commit 8e23b9d

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

NativeScript/ffi/node_api_util.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,16 @@ inline bool napiSupportsThreadsafeFunctions(void* dl) {
6060
return NULL; \
6161
}
6262

63-
#define NAPI_ERROR_INFO \
63+
#define NAPI_ERROR_INFO \
6464
const napi_extended_error_info* error_info = nullptr; \
6565
napi_get_last_error_info(env, &error_info);
6666

67-
#define NAPI_THROW_LAST_ERROR \
68-
{ NAPI_ERROR_INFO \
69-
napi_throw_error(env, NULL, error_info ? error_info->error_message : "Unknown error"); }
67+
#define NAPI_THROW_LAST_ERROR \
68+
{ \
69+
NAPI_ERROR_INFO \
70+
napi_throw_error( \
71+
env, NULL, error_info ? error_info->error_message : "Unknown error"); \
72+
}
7073

7174
#ifndef DEBUG
7275

0 commit comments

Comments
 (0)