added stack trace to some logging
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const { Rental, User, Item } = require("../models");
|
||||
const StripeService = require("./stripeService");
|
||||
const emailServices = require("./email");
|
||||
const logger = require("../utils/logger");
|
||||
const { Op } = require("sequelize");
|
||||
|
||||
class PayoutService {
|
||||
@@ -78,15 +79,18 @@ class PayoutService {
|
||||
// Send payout notification email to owner
|
||||
try {
|
||||
await emailServices.rentalFlow.sendPayoutReceivedEmail(rental.owner, rental);
|
||||
console.log(
|
||||
`Payout notification email sent to owner for rental ${rental.id}`
|
||||
);
|
||||
logger.info("Payout notification email sent to owner", {
|
||||
rentalId: rental.id,
|
||||
ownerId: rental.ownerId
|
||||
});
|
||||
} catch (emailError) {
|
||||
// Log error but don't fail the payout
|
||||
console.error(
|
||||
`Failed to send payout notification email for rental ${rental.id}:`,
|
||||
emailError.message
|
||||
);
|
||||
logger.error("Failed to send payout notification email", {
|
||||
error: emailError.message,
|
||||
stack: emailError.stack,
|
||||
rentalId: rental.id,
|
||||
ownerId: rental.ownerId
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user