Refactor logger and error handling modules

Moved isTrueFromDotEnv to logger.js and updated its usage. Simplified logger import and instantiation across modules. Added errors.js for centralized error exports. Set default error code in DefaultError. Cleaned up unused imports in utils.js.
This commit is contained in:
2026-01-27 04:08:46 +01:00
parent c531f2c82c
commit 2e30763da5
5 changed files with 11 additions and 8 deletions

View File

@@ -1,6 +1,4 @@
const path = require("node:path")
const Logger = require("./logger")
const logger = Logger.createLogger(path.join(__dirname, ".."))
const logger = require("./logger")
function sendValidationError(req, res, zodResult, type, path, errorConfig) {
const ip = req.headers["x-forwarded-for"] || req.socket.remoteAddress