* The method is used for handling errors and returning * response to the client
(error: unknown, ctx: HttpContext)
| 13 | * response to the client |
| 14 | */ |
| 15 | async handle(error: unknown, ctx: HttpContext) { |
| 16 | if (error instanceof Error) { |
| 17 | return ctx.response.status(500).send({ |
| 18 | message: "Internal server error", |
| 19 | error: error.message, |
| 20 | }); |
| 21 | } |
| 22 | return super.handle(error, ctx); |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * The method is used to report error to the logging service or |