Constructor
new MoyalError(message, secondopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
message |
string |
No message description was set to this error.
|
The error message. | |
second |
object | Error | string | null |
<optional> |
null
|
Either an object with `{ cause }`, or a direct cause/error. |
Classes
Members
cause
Gets the cause of the error (native or simulated).
fullStack
- Description:
- Builds a full stack trace including all nested causes, recursively.
- Source:
Builds a full stack trace including all nested causes, recursively.
(static) version
Returns the version of this library.
Methods
toJSON() → {MoyalErrorJSON}
- Description:
- Serializes the error into a JSON-friendly object, including metadata for structured logging.
- Source:
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:
Returns:
- Type
- string