Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

607 B
Raw Blame
import { getMemoryApiErrorMessage } from './memory';

describe('getMemoryApiErrorMessage', () => {
  it('preserves an actionable server error', () => {
    const error = Object.assign(new Error('Request failed'), {
      response: { data: { error: 'Value exceeds the configured character limit.' } },
    });

    expect(getMemoryApiErrorMessage(error, 'Error')).toBe(
      'Value exceeds the configured character limit.',
    );
  });

  it('falls back when the server does not provide an error', () => {
    expect(getMemoryApiErrorMessage(new Error('Request failed'), 'Error')).toBe('Error');
  });
});