Skip to content

Commit aa2d756

Browse files
committed
test(mcp): cover cooldown error → 503 categorization
1 parent fedf75e commit aa2d756

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

apps/sim/lib/mcp/utils.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,13 @@ describe('categorizeError', () => {
284284
expect(result.message).toBe('Invalid request parameters')
285285
})
286286

287+
it.concurrent('returns 503 for cooldown errors', () => {
288+
const error = new Error('Server recently failed and is in cooldown — try again shortly.')
289+
const result = categorizeError(error)
290+
expect(result.status).toBe(503)
291+
expect(result.message).toBe('Server temporarily unavailable')
292+
})
293+
287294
it.concurrent('returns 500 for generic errors', () => {
288295
const error = new Error('Something went wrong')
289296
const result = categorizeError(error)

0 commit comments

Comments
 (0)