added stack trace to some logging
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const EmailClient = require("../core/EmailClient");
|
||||
const TemplateManager = require("../core/TemplateManager");
|
||||
const logger = require("../../../utils/logger");
|
||||
|
||||
/**
|
||||
* RentalFlowEmailService handles rental lifecycle flow emails
|
||||
@@ -997,10 +998,12 @@ class RentalFlowEmailService {
|
||||
);
|
||||
}
|
||||
} catch (emailError) {
|
||||
console.error(
|
||||
`Failed to send rental completion email to renter (${renter.email}):`,
|
||||
emailError.message
|
||||
);
|
||||
logger.error("Failed to send rental completion email to renter", {
|
||||
error: emailError.message,
|
||||
stack: emailError.stack,
|
||||
renterEmail: renter.email,
|
||||
rentalId: rental.id
|
||||
});
|
||||
}
|
||||
|
||||
// Prepare owner email
|
||||
@@ -1114,13 +1117,19 @@ class RentalFlowEmailService {
|
||||
);
|
||||
}
|
||||
} catch (emailError) {
|
||||
console.error(
|
||||
`Failed to send rental completion email to owner (${owner.email}):`,
|
||||
emailError.message
|
||||
);
|
||||
logger.error("Failed to send rental completion email to owner", {
|
||||
error: emailError.message,
|
||||
stack: emailError.stack,
|
||||
ownerEmail: owner.email,
|
||||
rentalId: rental.id
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error sending rental completion emails:", error);
|
||||
logger.error("Error sending rental completion emails", {
|
||||
error: error.message,
|
||||
stack: error.stack,
|
||||
rentalId: rental?.id
|
||||
});
|
||||
}
|
||||
|
||||
return results;
|
||||
|
||||
Reference in New Issue
Block a user