Skip to content

Commit

Permalink
update logging
Browse files Browse the repository at this point in the history
  • Loading branch information
youngbryanyu committed Feb 23, 2024
1 parent deb8bb6 commit 613a7ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/src/redis/redisClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class RedisClient {
await RedisClient.client.connect();
logger.info('Successfully connected to Redis');
} catch (error) {
logger.error('Error connecting to redis:\n', error);
logger.error('Error occurred while connecting to redis:\n', error);
throw error;
}
}
Expand Down
2 changes: 2 additions & 0 deletions backend/src/user/controllers/userController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Request, Response } from 'express';
import { User } from '../models/user';
import { UserResponses } from '../constants';
import { GenericResponses } from '../../constants';
import logger from '../../logging/logger';

/**
* Business logic for user related APIs
Expand Down Expand Up @@ -46,6 +47,7 @@ class UserController {
message: UserResponses._201_UserCreateSuccessful
});
} catch (error) {
logger.error('Error occurred during user creation:\n', error);
res.status(500).json({
message: GenericResponses._500
});
Expand Down

0 comments on commit 613a7ce

Please sign in to comment.