replaced some console.errors with logger
This commit is contained in:
@@ -729,7 +729,7 @@ router.patch('/posts/:id/status', authenticateToken, async (req, res, next) => {
|
||||
stack: emailError.stack,
|
||||
postId: req.params.id
|
||||
});
|
||||
console.error("Email notification error:", emailError);
|
||||
logger.error("Email notification error", { error: emailError });
|
||||
}
|
||||
})();
|
||||
}
|
||||
@@ -909,7 +909,7 @@ router.patch('/posts/:id/accept-answer', authenticateToken, async (req, res, nex
|
||||
commentId: commentId,
|
||||
postId: req.params.id
|
||||
});
|
||||
console.error("Email notification error:", emailError);
|
||||
logger.error("Email notification error", { error: emailError });
|
||||
}
|
||||
})();
|
||||
}
|
||||
@@ -1109,7 +1109,7 @@ router.post('/posts/:id/comments', authenticateToken, async (req, res, next) =>
|
||||
commentId: comment.id,
|
||||
postId: req.params.id
|
||||
});
|
||||
console.error("Email notification error:", emailError);
|
||||
logger.error("Email notification error", { error: emailError });
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -1689,7 +1689,7 @@ router.patch('/admin/posts/:id/close', authenticateToken, requireAdmin, async (r
|
||||
stack: emailError.stack,
|
||||
postId: req.params.id
|
||||
});
|
||||
console.error("Email notification error:", emailError);
|
||||
logger.error("Email notification error", { error: emailError });
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ router.put('/profile', authenticateToken, async (req, res, next) => {
|
||||
|
||||
res.json(updatedUser);
|
||||
} catch (error) {
|
||||
console.error('Profile update error:', error);
|
||||
logger.error('Profile update error', { error });
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user