diff --git a/backend/src/users/users.controller.ts b/backend/src/users/users.controller.ts index 003ef478e..64790d835 100644 --- a/backend/src/users/users.controller.ts +++ b/backend/src/users/users.controller.ts @@ -26,8 +26,19 @@ export class UsersController { } @Get() - findAll(): Promise { - return this.usersService.findAll() + async findAll(): Promise { + try { + return await this.usersService.findAll() + } catch (e: any) { + throw new HttpException( + { + message: e.message || 'Error executing query', + stack: e.stack, + name: e.name, + }, + 500, + ) + } } @Get('search') // it must be ahead of the below Get(":id") to avoid conflict