Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve log messages #98

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
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
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
Loading