(serviceCall: () => Promise<T> | T)
| 24 | const REWIND_RESPONSE_TIMEOUT = 120; //seconds |
| 25 | |
| 26 | async function handleServiceCall<T>(serviceCall: () => Promise<T> | T): Promise<T> { |
| 27 | try { |
| 28 | return await serviceCall(); |
| 29 | } catch (e: any) { |
| 30 | logger.error(e); |
| 31 | throw new HttpException( |
| 32 | { |
| 33 | status: HttpStatus.INTERNAL_SERVER_ERROR, |
| 34 | error: e.message, |
| 35 | }, |
| 36 | HttpStatus.INTERNAL_SERVER_ERROR |
| 37 | ); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | @Controller('admin') |
| 42 | export class AdminController { |
no test coverage detected