napi_fatal_error
NAPI_NO_RETURN void napi_fatal_error(const char* location,
size_t location_len,
const char* message,
size_t message_len);
-
[in] location
:发生错误的可选位置。¥
[in] location
: Optional location at which the error occurred. -
[in] location_len
:位置的长度(以字节为单位),如果它以 null 结尾则为NAPI_AUTO_LENGTH
。¥
[in] location_len
: The length of the location in bytes, orNAPI_AUTO_LENGTH
if it is null-terminated. -
[in] message
:与错误关联的消息。¥
[in] message
: The message associated with the error. -
[in] message_len
:消息的长度(以字节为单位),如果以 null 结尾则为NAPI_AUTO_LENGTH
。¥
[in] message_len
: The length of the message in bytes, orNAPI_AUTO_LENGTH
if it is null-terminated.
函数调用不返回,进程将终止。
¥The function call does not return, the process will be terminated.
即使存在挂起的 JavaScript 异常,也可以调用此 API。
¥This API can be called even if there is a pending JavaScript exception.