(res: Response)
| 9 | } |
| 10 | |
| 11 | static createCatcher(res: Response) { |
| 12 | return function (error: CaptainError | any) { |
| 13 | if (!error || error.errorStatus !== 404) { |
| 14 | Logger.e(error) |
| 15 | } |
| 16 | |
| 17 | if (error && error.captainErrorType) { |
| 18 | res.send(new BaseApi(error.captainErrorType, error.apiMessage)) |
| 19 | return |
| 20 | } |
| 21 | |
| 22 | if (error && error.errorStatus) { |
| 23 | res.sendStatus(Number(error.errorStatus)) |
| 24 | return |
| 25 | } |
| 26 | |
| 27 | res.sendStatus(500) |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | static readonly STATUS_ERROR_GENERIC = 1000 |
| 32 | static readonly STATUS_OK = 100 |
no test coverage detected