UNPKG

recallrai

Version:

Official Node.js SDK for RecallrAI - Revolutionary contextual memory system that enables AI assistants to form meaningful connections between conversations, just like human memory.

33 lines (32 loc) 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RecallrAIError = void 0; /** * Base exception for all RecallrAI SDK errors. */ class RecallrAIError extends Error { /** * Initialize a RecallrAI error. * * @param message - A human-readable error message * @param code - An optional error code * @param httpStatus - The HTTP status code that triggered this error * @param details - Optional additional details about the error */ constructor(message, code, httpStatus, details) { super(message); this.name = this.constructor.name; this.code = code; this.httpStatus = httpStatus; this.details = details || {}; // Ensure proper inheritance in Node.js Object.setPrototypeOf(this, RecallrAIError.prototype); } /** * Return a string representation of the error. */ toString() { return `${this.message}. HTTP Status: ${this.httpStatus}`; } } exports.RecallrAIError = RecallrAIError;