errors.test.js 478 Bytes
import { describe, expect, it } from 'vitest'
import { LLMError } from '../src/errors.js'

describe('LLMError response metadata', () => {
  it('contentFilter is a client-visible expected failure', () => {
    const error = new LLMError({
      provider: 'azure_foundry',
      reason: 'contentFilter',
      retryable: false,
      message: '[azure_foundry] content filtered',
    })

    expect(error.code).toBe('CONTENT_FILTER')
    expect(error.statusCode).toBe(400)
  })
})