Spaces:
Runtime error
Runtime error
Download src/common/errors/call-not-found.error.spec.ts from MuhammadNoman7600/qwen_2.5_model: direct link, hf CLI and curl.
- Browser
- Download file 730 Bytes
-
https://huggingface.co/spaces/MuhammadNoman7600/qwen_2.5_model/resolve/main/src/common/errors/call-not-found.error.spec.ts
- Command line
-
hf download hf://spaces/MuhammadNoman7600/qwen_2.5_model/src/common/errors/call-not-found.error.spec.ts
-
curl -L -o call-not-found.error.spec.ts https://huggingface.co/spaces/MuhammadNoman7600/qwen_2.5_model/resolve/main/src/common/errors/call-not-found.error.spec.ts
730 Bytes
| import { NotFoundException } from '@nestjs/common'; | |
| import { CallNotFoundError } from './call-not-found.error'; | |
| // Rejecting an unknown/expired call id must surface as HTTP 404, not a raw 500 — same mapping | |
| // discipline as MessageNotFoundError (built-in NestJS handler, no custom global filter). | |
| describe('CallNotFoundError', () => { | |
| it('is a NotFoundException -> HTTP 404 without a custom global filter', () => { | |
| const err = new CallNotFoundError('CALL1'); | |
| expect(err).toBeInstanceOf(NotFoundException); | |
| expect(err.getStatus()).toBe(404); | |
| }); | |
| it('formats the message with the call id', () => { | |
| expect(new CallNotFoundError('CALL1').message).toBe('Call CALL1 not found or no longer ringing'); | |
| }); | |
| }); | |