mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 20:49:42 +03:00
Fixed exception handling in user module
This commit is contained in:
@@ -22,8 +22,10 @@ export class UserService {
|
|||||||
return user;
|
return user;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.debug(`[user.getUser] ${JSON.stringify({ error })}`);
|
this.logger.debug(`[user.getUser] ${JSON.stringify({ error })}`);
|
||||||
|
throw new HttpException('Internal Server Error', HttpStatus.INTERNAL_SERVER_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async banUser(id: string) {
|
async banUser(id: string) {
|
||||||
try {
|
try {
|
||||||
this.logger.debug(`[user.banUser] id: ${JSON.stringify(id)}`);
|
this.logger.debug(`[user.banUser] id: ${JSON.stringify(id)}`);
|
||||||
@@ -40,6 +42,7 @@ export class UserService {
|
|||||||
return user;
|
return user;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.debug(`[user.banUser] ${JSON.stringify({ error })}`);
|
this.logger.debug(`[user.banUser] ${JSON.stringify({ error })}`);
|
||||||
|
throw new HttpException('Error occurred', HttpStatus.INTERNAL_SERVER_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,6 +63,9 @@ export class UserService {
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
this.logger.debug(`[user.deBanUser] ${JSON.stringify({ error })}`);
|
this.logger.debug(`[user.deBanUser] ${JSON.stringify({ error })}`);
|
||||||
|
throw new HttpException(`Error occurred`, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async getBannedUsers() {
|
async getBannedUsers() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user