added stack trace to some logging

This commit is contained in:
jackiettran
2025-12-25 18:41:42 -05:00
parent b02ec19d5c
commit 76e4039ba8
15 changed files with 307 additions and 173 deletions

View File

@@ -466,6 +466,7 @@ router.put("/:id/status", authenticateToken, async (req, res) => {
"Failed to send rental approval confirmation email to owner",
{
error: emailError.message,
stack: emailError.stack,
rentalId: updatedRental.id,
ownerId: updatedRental.ownerId,
}
@@ -505,6 +506,7 @@ router.put("/:id/status", authenticateToken, async (req, res) => {
"Failed to send rental confirmation email to renter",
{
error: emailError.message,
stack: emailError.stack,
rentalId: updatedRental.id,
renterId: updatedRental.renterId,
}
@@ -568,6 +570,7 @@ router.put("/:id/status", authenticateToken, async (req, res) => {
"Failed to send rental approval confirmation email to owner",
{
error: emailError.message,
stack: emailError.stack,
rentalId: updatedRental.id,
ownerId: updatedRental.ownerId,
}
@@ -607,6 +610,7 @@ router.put("/:id/status", authenticateToken, async (req, res) => {
"Failed to send rental confirmation email to renter",
{
error: emailError.message,
stack: emailError.stack,
rentalId: updatedRental.id,
renterId: updatedRental.renterId,
}
@@ -1112,6 +1116,7 @@ router.post("/:id/cancel", authenticateToken, async (req, res, next) => {
const reqLogger = logger.withRequestId(req.id);
reqLogger.error("Failed to send cancellation emails", {
error: emailError.message,
stack: emailError.stack,
rentalId: updatedRental.id,
cancelledBy: updatedRental.cancelledBy,
});
@@ -1206,6 +1211,7 @@ router.post("/:id/mark-return", authenticateToken, async (req, res, next) => {
const reqLogger = logger.withRequestId(req.id);
reqLogger.error("Failed to send rental completion emails", {
error: emailError.message,
stack: emailError.stack,
rentalId,
});
}
@@ -1294,6 +1300,7 @@ router.post("/:id/mark-return", authenticateToken, async (req, res, next) => {
const reqLogger = logger.withRequestId(req.id);
reqLogger.error("Error marking return status", {
error: error.message,
stack: error.stack,
rentalId: req.params.id,
userId: req.user.id,
});
@@ -1376,6 +1383,7 @@ router.post("/:id/report-damage", authenticateToken, async (req, res, next) => {
const reqLogger = logger.withRequestId(req.id);
reqLogger.error("Error reporting damage", {
error: error.message,
stack: error.stack,
rentalId: req.params.id,
userId: req.user.id,
});