Skip to content

Commit

Permalink
Merge pull request #98 from Giveth/1375_improve_log_messages
Browse files Browse the repository at this point in the history
Improve  log messages
  • Loading branch information
mohammadranjbarz committed Jun 12, 2024
2 parents f4beafa + 6c5b80a commit 870e498
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/routes/v1/notificationRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
} from '../../middlewares/authentication';
import { NotificationsController } from '../../controllers/v1/notificationsController';
import { sendStandardResponse } from '../../utils/responseUtils';
import { logger } from '../../utils/logger';
import { createNewUserAddressIfNotExists } from '../../repositories/userAddressRepository';

export const notificationRouter = express.Router();
Expand All @@ -22,6 +23,7 @@ notificationRouter.post(
});
return sendStandardResponse({ res, result });
} catch (e) {
logger.error('/thirdParty/notifications error', e);
next(e);
}
},
Expand All @@ -41,6 +43,7 @@ notificationRouter.post(
);
return sendStandardResponse({ res, result });
} catch (e) {
logger.error('/thirdParty/notificationsBulk error', e);
next(e);
}
},
Expand All @@ -65,6 +68,7 @@ notificationRouter.get(
);
return sendStandardResponse({ res, result });
} catch (e) {
logger.error('/notifications error', e);
next(e);
}
},
Expand All @@ -85,6 +89,7 @@ notificationRouter.put(
);
return sendStandardResponse({ res, result });
} catch (e) {
logger.error('/notifications/read/:notificationId error', e);
next(e);
}
},
Expand All @@ -100,6 +105,7 @@ notificationRouter.get(
);
return sendStandardResponse({ res, result });
} catch (e) {
logger.error('/notifications/countUnread/:walletAddress error', e);
next(e);
}
},
Expand All @@ -120,6 +126,7 @@ notificationRouter.put(
);
return sendStandardResponse({ res, result });
} catch (e) {
logger.error('/notifications/readAll error', e);
next(e);
}
},
Expand Down
4 changes: 4 additions & 0 deletions src/routes/v1/notificationSettingsRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import express, { Request, Response } from 'express';
import { validateAuthMicroserviceJwt } from '../../middlewares/authentication';
import { NotificationSettingsController } from '../../controllers/v1/notificationSettingsController';
import { sendStandardResponse } from '../../utils/responseUtils';
import { logger } from '../../utils/logger';

export const notificationSettingsRouter = express.Router();

Expand All @@ -25,6 +26,7 @@ notificationSettingsRouter.get(
);
return sendStandardResponse({ res, result });
} catch (e) {
logger.error('get /notification_settings error', e);
next(e);
}
},
Expand All @@ -47,6 +49,7 @@ notificationSettingsRouter.put(
);
return sendStandardResponse({ res, result });
} catch (e) {
logger.error('/notification_settings/:id error', e);
next(e);
}
},
Expand All @@ -68,6 +71,7 @@ notificationSettingsRouter.put(
);
return sendStandardResponse({ res, result });
} catch (e) {
logger.error('put /notification_settings error', e);
next(e);
}
},
Expand Down

0 comments on commit 870e498

Please sign in to comment.