mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
wip: removing console log
This commit is contained in:
1 parent
515aefcadc
commit
82d1004ecf
16 files changed
+57
-34
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user