Overview
TheMemMachineAPIError class is a custom error implementation used to represent failures returned by MemMachine client methods. It serves as the primary mechanism for catching and identifying SDK-specific issues.
Hierarchy
- Error
- MemMachineAPIError
Constructor
new MemMachineAPIError(message)
Initializes a new instance of the error with a specific descriptive message.
| Parameter | Type | Description |
|---|---|---|
message | string | Error message describing the failure. |
Properties
| Property | Type | Description |
|---|---|---|
message | string | The error message inherited from the base Error class. |
name | string | The name identifier for the error class. |
stack | string | (Optional) A string representing the location in the code at which the error was thrown. |
stackTraceLimit | number | Static. Specifies the number of stack frames collected by a stack trace. Default is 10. |
Methods
captureStackTrace()
Static
.stack property on targetObject, which when accessed returns a string representing the location in the code at which the method was called. This is useful for hiding implementation details of error generation from the user.
prepareStackTrace()
Usage Example
IntegrateMemMachineAPIError into your error handling logic to differentiate between API-specific failures and general runtime errors.
This class is defined in
src/errors/memmachine-api-error.ts. 
