The TypeError class is a representation of the JavaScript TypeError
that is
thrown when an operand or argument passed to a function is incompatible with the
type expected by the operator or function.
The TypeError class inherits its behaviors from the Error class (for more info see: Error).
For more details about error handling refer to the section titled Error handling.
Creates a new instance of the TypeError
object.
TypeError::New(Napi:Env env, const char* message);
[in] Env
: The environment in which to construct theTypeError
object.[in] message
: Null-terminated string to be used as the message for theTypeError
.
Returns an instance of a TypeError
object.
Creates a new instance of a TypeError
object.
TypeError::New(Napi:Env env, const std::string& message);
[in] Env
: The environment in which to construct theTypeError
object.[in] message
: Reference string to be used as the message for theTypeError
.
Returns an instance of a TypeError
object.
Creates a new empty instance of a TypeError
.
TypeError();
Initializes a TypeError
instance from an existing JavaScript error object.
TypeError(napi_env env, napi_value value);
[in] Env
: The environment in which to construct theTypeError
object.[in] value
: TheError
reference to wrap.
Returns an instance of a TypeError
object.