Use response handler in handleErrors middleare

This commit is contained in:
Alex Holliday committed 2025-01-19 20:14:03 -08:00
1 parent e9eadfe838
commit 9f43336a03
4 files changed
+11 -5

No files matched your search

+4 -1
View File
@@ -11,7 +11,10 @@ const handleErrors = (error, req, res, next) => {
method: error.method,
stack: error.stack,
});
res.status(status).json({ success: false, msg: message });
res.error({
status,
msg: message,
});
};
export { handleErrors };