napi_throw

Function napi_throw 

Source
pub unsafe extern "C" fn napi_throw(
    env: napi_env,
    error: napi_value,
) -> napi_status
Available on crate feature napi only.
Expand description

Throws an ArkTS error.

§Arguments

  • env - Current running virtual machine context.

  • error - The ArkTS error to be thrown.

§Returns

  • Returns the function execution status. [napi_ok] If the function executed successfully.

[napi_invalid_arg] If env or error is nullptr, or error is not an error object.

Available since API-level: 10