Constructor
new ArgumentError(message, argumentNameopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string | The error message. | |
argumentName |
string |
<optional> |
The name of the argument that caused the error. |
Extends
Classes
Members
argumentName
Gets the name of the argument that caused the error.
cause
- Description:
- Gets the cause of the error (native or simulated).
- Source:
- Overrides:
Gets the cause of the error (native or simulated).
fullStack
- Description:
- Builds a full stack trace including all nested causes, recursively.
- Source:
- Overrides:
Builds a full stack trace including all nested causes, recursively.
Methods
toJSON() → {MoyalErrorJSON}
- Description:
- Serializes the error into a JSON-friendly object, including metadata for structured logging.
- Source:
- Overrides:
Returns:
A plain object with name, message, stack, timestamp, and cause.
- Type
- MoyalErrorJSON
toString() → {string}
- Description:
- Returns a string representation of the error including chained causes.
- Source:
- Overrides:
Returns:
- Type
- string