NodeJsException Class

Represents an error raised by JavaScript code, or a failure of the Node.js process hosting it.

public sealed class NodeJsException : Exception
Inheritance
Exception NodeJsException

Constructors

NameDescription
NodeJsException()Initializes a new instance of NodeJsException.
NodeJsException(string)Initializes a new instance of NodeJsException with the specified message.
NodeJsException(string, Exception)Initializes a new instance of NodeJsException with the specified message and inner exception.

NodeJsException overloads

NodeJsException()

NodeJsException.cs

Initializes a new instance of NodeJsException.

public NodeJsException()

NodeJsException(string)

NodeJsException.cs

Initializes a new instance of NodeJsException with the specified message.

public NodeJsException(string message)
Parameters
message string

NodeJsException(string, Exception)

NodeJsException.cs

Initializes a new instance of NodeJsException with the specified message and inner exception.

public NodeJsException(string message, Exception innerException)
Parameters
message string
innerException Exception

Properties

NameDescription
ExitCodeGets the exit code of the Node.js process when the error is caused by the process exiting.
JavaScriptErrorCodeGets the code property of the JavaScript error (e.g. ENOENT for the errors of node:fs), converted to a string, or null when the error has no code.
JavaScriptErrorNameGets the name of the JavaScript error (e.g. TypeError), or null when the error does not come from JavaScript code.
JavaScriptStackGets the JavaScript stack trace, if available.

Gets the exit code of the Node.js process when the error is caused by the process exiting.

public int? ExitCode { get; }

Property value

int?

JavaScriptErrorCode

NodeJsException.cs

Gets the code property of the JavaScript error (e.g. ENOENT for the errors of node:fs), converted to a string, or null when the error has no code.

public string? JavaScriptErrorCode { get; }

Property value

string?

Remarks

The cause of the JavaScript error, if any, is the Exception.InnerException.

JavaScriptErrorName

NodeJsException.cs

Gets the name of the JavaScript error (e.g. TypeError), or null when the error does not come from JavaScript code.

public string? JavaScriptErrorName { get; }

Property value

string?

JavaScriptStack

NodeJsException.cs

Gets the JavaScript stack trace, if available.

public string? JavaScriptStack { get; }

Property value

string?