Methods
MoyalError.() → {boolean}
- Description:
- Tests if the current runtime supports native Error `cause` (ES2022).
- Source:
Returns:
-
Type
-
boolean
MoyalError.(str) → {string}
- Description:
- Indents all lines with a tab.
- Source:
Parameters:
Name |
Type |
Description |
str |
string
|
|
Returns:
-
Type
-
string
extendNativeError()
- Description:
- Extends the native Javascript Error type to contain toJSON function.
- Source:
printCauseChain(error) → {string}
- Description:
- Builds a readable, indented summary of the cause chain.
- Source:
Parameters:
Name |
Type |
Description |
error |
Error
|
The error to trace. |
Returns:
A multiline string with each cause indented by depth.
-
Type
-
string
throwIfEmptyString(value, argumentNameopt)
- Description:
- Source:
Parameters:
Name |
Type |
Attributes |
Description |
value |
*
|
|
The value to check. |
argumentName |
string
|
<optional>
|
The name of the argument being checked. |
Throws:
throwIfNull(value, argumentNameopt)
- Description:
- Source:
Parameters:
Name |
Type |
Attributes |
Description |
value |
*
|
|
The value to check. |
argumentName |
string
|
<optional>
|
The name of the argument being checked. |
Throws:
throwIfNullOrUndefined(value, argumentNameopt)
- Description:
- Throws an ArgumentError if the given value is `null` or `undefined`.
- Source:
Parameters:
Name |
Type |
Attributes |
Description |
value |
*
|
|
The value to check. |
argumentName |
string
|
<optional>
|
The name of the argument being checked. |
Throws:
throwIfNullOrWhitespace(value, argumentNameopt)
- Description:
- Throws an ArgumentError if the given value is `null`, `undefined`,
or a string that is empty or only whitespace.
- Source:
Parameters:
Name |
Type |
Attributes |
Description |
value |
*
|
|
The value to check. |
argumentName |
string
|
<optional>
|
The name of the argument being checked. |
Throws:
throwIfUndefined(value, argumentNameopt)
- Description:
- Source:
Parameters:
Name |
Type |
Attributes |
Description |
value |
*
|
|
The value to check. |
argumentName |
string
|
<optional>
|
The name of the argument being checked. |
Throws:
throwMissingArgument(argumentNameopt)
- Description:
- Always throws an ArgumentError indicating a required argument is missing.
- Source:
Parameters:
Name |
Type |
Attributes |
Description |
argumentName |
string
|
<optional>
|
The name of the missing argument. |
Throws:
version() → {string}
- Description:
- Returns the semantic version of this library.
- Source:
Returns:
- The semantic version of this library.
-
Type
-
string
Type Definitions
MoyalErrorJSON
- Source:
Properties:
Name |
Type |
Attributes |
Description |
name |
string
|
|
The name of the error (usually the class name). |
message |
string
|
|
The error message. |
timestamp |
string
|
|
ISO 8601 timestamp of when the error was created. |
stack |
string
|
undefined
|
|
The error's stack trace. |
cause |
MoyalErrorJSON
|
object
|
string
|
null
|
<optional>
|
The nested cause (recursively serialized if available). |
type |
string
|
|
The actual class name (e.g., "MoyalError"). |
Type: