Errors
NAN includes helpers for creating, throwing and catching Errors as much of this functionality varies across the supported versions of V8 and must be abstracted.
Note that an Error object is simply a specialized form of v8::Value
.
Also consult the V8 Embedders Guide section on Exceptions for more information.
Nan::Error()
Create a new Error object using the v8::Exception class in a way that is compatible across the supported versions of V8.
Note that an Error object is simply a specialized form of v8::Value
.
Signature:
Nan::RangeError()
Create a new RangeError object using the v8::Exception class in a way that is compatible across the supported versions of V8.
Note that an RangeError object is simply a specialized form of v8::Value
.
Signature:
Nan::ReferenceError()
Create a new ReferenceError object using the v8::Exception class in a way that is compatible across the supported versions of V8.
Note that an ReferenceError object is simply a specialized form of v8::Value
.
Signature:
Nan::SyntaxError()
Create a new SyntaxError object using the v8::Exception class in a way that is compatible across the supported versions of V8.
Note that an SyntaxError object is simply a specialized form of v8::Value
.
Signature:
Nan::TypeError()
Create a new TypeError object using the v8::Exception class in a way that is compatible across the supported versions of V8.
Note that an TypeError object is simply a specialized form of v8::Value
.
Signature:
Nan::ThrowError()
Throw an Error object (a specialized v8::Value
as above) in the current context. If a msg
is provided, a new Error object will be created.
Signature:
Nan::ThrowRangeError()
Throw an RangeError object (a specialized v8::Value
as above) in the current context. If a msg
is provided, a new RangeError object will be created.
Signature:
Nan::ThrowReferenceError()
Throw an ReferenceError object (a specialized v8::Value
as above) in the current context. If a msg
is provided, a new ReferenceError object will be created.
Signature:
Nan::ThrowSyntaxError()
Throw an SyntaxError object (a specialized v8::Value
as above) in the current context. If a msg
is provided, a new SyntaxError object will be created.
Signature:
Nan::ThrowTypeError()
Throw an TypeError object (a specialized v8::Value
as above) in the current context. If a msg
is provided, a new TypeError object will be created.
Signature:
Nan::FatalException()
Replaces node::FatalException()
which has a different API across supported versions of Node. For use with Nan::TryCatch
.
Signature:
Nan::ErrnoException()
Replaces node::ErrnoException()
which has a different API across supported versions of Node.
Signature:
Nan::TryCatch
A simple wrapper around v8::TryCatch
compatible with all supported versions of V8. Can be used as a direct replacement in most cases. See also Nan::FatalException()
for an internal use compatible with node::FatalException
.
Signature:
Last updated