move to src

This commit is contained in:
Alex Holliday committed 2025-07-25 15:33:48 -07:00
1 parent acc910cbc0
commit 1c47c8ce2c
127 files changed
+71 -19

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import logger from "../utils/logger.js";
import ServiceRegistry from "../service/system/serviceRegistry.js";
import StringService from "../service/system/stringService.js";
const handleErrors = (error, req, res, next) => {
const status = error.status || 500;
const stringService = ServiceRegistry.get(StringService.SERVICE_NAME);
const message = error.message || stringService.authIncorrectPassword;
const service = error.service || stringService.unknownService;
logger.error({
message: message,
service: service,
method: error.method,
stack: error.stack,
});
res.error({
status,
msg: message,
});
};
export { handleErrors };