ArgumentError

ArgumentError

Represents an error caused by invalid or missing function arguments. Inherits from `MoyalError`.

Constructor

new ArgumentError(message, argumentNameopt)

Description:
  • Constructs a new ArgumentError.
Source:
Parameters:
Name Type Attributes Description
message string The error message.
argumentName string <optional>
The name of the argument that caused the error.

Extends

Classes

ArgumentError

Members

argumentName

Description:
  • Gets the name of the argument that caused the error.
Source:
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