Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions backend/src/users/users.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,19 @@ export class UsersController {
}

@Get()
findAll(): Promise<UserDto[]> {
return this.usersService.findAll()
async findAll(): Promise<UserDto[]> {
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
Expand Down
Loading