Spaces:
Runtime error
Runtime error
Download src/common/errors/message-not-found.error.spec.ts from MuhammadNoman7600/qwen_2.5_model: direct link, hf CLI and curl.
- Browser
- Download file 977 Bytes
-
https://huggingface.co/spaces/MuhammadNoman7600/qwen_2.5_model/resolve/main/src/common/errors/message-not-found.error.spec.ts
- Command line
-
hf download hf://spaces/MuhammadNoman7600/qwen_2.5_model/src/common/errors/message-not-found.error.spec.ts
-
curl -L -o message-not-found.error.spec.ts https://huggingface.co/spaces/MuhammadNoman7600/qwen_2.5_model/resolve/main/src/common/errors/message-not-found.error.spec.ts
977 Bytes
| import { NotFoundException } from '@nestjs/common'; | |
| import { MessageNotFoundError } from './message-not-found.error'; | |
| // reply/forward/react/delete on a message outside the adapter's fetch/store window threw a | |
| // raw Error -> HTTP 500. MessageNotFoundError extends NotFoundException so NestJS maps it to 404 | |
| // through the built-in handler (no global filter), surviving the message.service passthrough. | |
| describe('MessageNotFoundError', () => { | |
| it('is a NotFoundException -> HTTP 404 without a custom global filter', () => { | |
| const err = new MessageNotFoundError('ABC'); | |
| expect(err).toBeInstanceOf(NotFoundException); | |
| expect(err.getStatus()).toBe(404); | |
| }); | |
| it('formats the message, optionally including the chat id', () => { | |
| expect(new MessageNotFoundError('ABC').message).toBe('Message ABC not found'); | |
| expect(new MessageNotFoundError('ABC', 'c@s.whatsapp.net').message).toBe( | |
| 'Message ABC not found in chat c@s.whatsapp.net', | |
| ); | |
| }); | |
| }); | |