| 24 | } |
| 25 | |
| 26 | @Controller('/test') |
| 27 | class TestController extends ApiController { |
| 28 | @HttpGet('/throwSync') |
| 29 | throwSync(): any { |
| 30 | throw new HttpResponseException(HttpStatusCode.internalServerError, |
| 31 | { data: 'InternalServerError' }); |
| 32 | } |
| 33 | |
| 34 | @Async() |
| 35 | @HttpGet('/throwAsync') |
| 36 | async throwAsync(): Promise<void> { |
| 37 | throw new HttpResponseException(HttpStatusCode.unauthorized, |
| 38 | { data: 'Unauthorized' }); |
| 39 | } |
| 40 | |
| 41 | @HttpGet('/badRequest') |
| 42 | requestEx(): Promise<void> { |
| 43 | throw new BadRequestException({ data: 'BadRequest' }); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | describe('http.exception.e2e.spec', () => { |
| 48 | const baseRoute = '/api/test'; |
nothing calls this directly
no test coverage detected