Skip to content
napi-bindings

Search

Search pages, projects and the Node-API reference

Browse Node-APIshow

node_api_throw_syntax_error

functionv9js_native_api.h

This API throws a JavaScript SyntaxError with the text provided.

NAPI_EXTERN napi_status node_api_throw_syntax_error(napi_env env,
                                                    const char* code,
                                                    const char* msg);
  • [in] env: The environment that the API is invoked under.
  • [in] code: Optional error code to be set on the error.
  • [in] msg: C string representing the text to be associated with the error.

Returns napi_ok if the API succeeded.

This API throws a JavaScript SyntaxError with the text provided.

View in the official Node.js documentation