wip: removing console log

This commit is contained in:
Lin, Hung-Shin committed 2023-11-20 14:59:14 +08:00
1 parent 515aefcadc
commit 82d1004ecf
16 files changed
+57 -34

No files matched your search

+3 -1
View File
@@ -1,3 +1,5 @@
import logger from '../utils/logger.js'
export function asyncHandler(fn) {
return (req, res, next) => {
fn(req, res, next).catch(next)
@@ -6,6 +8,6 @@ export function asyncHandler(fn) {
// eslint-disable-next-line no-unused-vars
export default function errorHandler(err, req, res, next) {
console.error(err.stack) // Log error stack trace to the console
logger.error(err) // Log error stack trace to the console
res.status(500).send({ message: 'Something broke!' }) // Send error response
}