1.6 KiB
RangeError
The Napi::RangeError
class is a representation of the
JavaScript RangeError
that is thrown when trying to pass a
value as an argument to a function that does not allow a range that
includes the value.
The Napi::RangeError
class inherits its behaviors from
the Napi::Error
class (for more info see: Napi::Error
).
For more details about error handling refer to the section titled Error handling.
Methods
New
Creates a new instance of a Napi::RangeError
object.
::RangeError::New(Napi::Env env, const char* message); Napi
[in] Env
: The environment in which to construct theNapi::RangeError
object.[in] message
: Null-terminated string to be used as the message for theNapi::RangeError
.
Returns an instance of a Napi::RangeError
object.
New
Creates a new instance of a Napi::RangeError
object.
::RangeError::New(Napi::Env env, const std::string& message); Napi
[in] Env
: The environment in which to construct theNapi::RangeError
object.[in] message
: Reference string to be used as the message for theNapi::RangeError
.
Returns an instance of a Napi::RangeError
object.
Constructor
Creates a new empty instance of a Napi::RangeError
.
::RangeError::RangeError(); Napi
Constructor
Initializes a Napi::RangeError
instance from an existing
Javascript error object.
::RangeError::RangeError(napi_env env, napi_value value); Napi
[in] Env
: The environment in which to construct theNapi::RangeError
object.[in] value
: TheNapi::Error
reference to wrap.
Returns an instance of a Napi::RangeError
object.