From f1034e596d2f0d75fe5065fe05b39bba3e9894a1 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Thu, 8 Aug 2024 13:54:00 +0700 Subject: [PATCH] Create errorHandler.js --- .../backend/contract-sphere-backend/utils/errorHandler.js | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 projects/ContractSphere/backend/contract-sphere-backend/utils/errorHandler.js diff --git a/projects/ContractSphere/backend/contract-sphere-backend/utils/errorHandler.js b/projects/ContractSphere/backend/contract-sphere-backend/utils/errorHandler.js new file mode 100644 index 000000000..e6b5b5c42 --- /dev/null +++ b/projects/ContractSphere/backend/contract-sphere-backend/utils/errorHandler.js @@ -0,0 +1,4 @@ +export const errorHandler = (err, req, res, next) => { + console.error(err); + res.status(500).json({ message: 'Internal Server Error' }); +};