pub unsafe extern "C" fn napi_create_error(
env: napi_env,
code: napi_value,
msg: napi_value,
result: *mut napi_value,
) -> napi_statusAvailable on crate feature
napi only.Expand description
Creates an ArkTS Error with text information.
§Arguments
-
env- Current running virtual machine context. -
code- Optional error code to set on the error. -
msg- napi_value representing the EcmaScript string to be associated with the error. -
result- napi_value representing the error created.
§Returns
- Returns the function execution status.
[
napi_ok] If the function executed successfully.
[napi_invalid_arg] If env, msg or result is nullptr, code is not string and number type or msg is
not a string type.
Available since API-level: 10