feat: handle http exceptions (#456)

This commit is contained in:
Ahmed Bouhuolia
2024-05-22 19:30:41 +02:00
committed by GitHub
parent 1227111fae
commit 0836fe14e0
14 changed files with 102 additions and 66 deletions

View File

@@ -155,6 +155,7 @@ export default class UsersController extends BaseController {
try {
const user = await this.usersService.getUser(tenantId, userId);
return res.status(200).send({ user });
} catch (error) {
next(error);
@@ -229,7 +230,7 @@ export default class UsersController extends BaseController {
* @param {Response} res
* @param {NextFunction} next
*/
catchServiceErrors(
private catchServiceErrors(
error: Error,
req: Request,
res: Response,