ваше сообщение коммита

This commit is contained in:
2025-06-01 15:13:52 +03:00
parent 03ea1cf726
commit 2507d776e0
32 changed files with 1832 additions and 445 deletions

View File

@@ -5,13 +5,12 @@ const { ERROR_CODES } = require('../utils/constants');
/**
* Middleware для обработки ошибок
*/
// eslint-disable-next-line no-unused-vars
const errorHandler = (err, req, res, /* next */) => {
const errorHandler = (err, req, res, next) => {
console.log('errorHandler called, arguments:', arguments);
console.log('typeof res:', typeof res, 'isFunction:', typeof res === 'function');
console.error('errorHandler: err =', err);
console.error('errorHandler: typeof err =', typeof err);
console.error('errorHandler: stack =', err && err.stack);
console.log('errorHandler called, typeof res:', typeof res, 'res:', res);
console.log('typeof res:', typeof res, 'isFunction:', typeof res === 'function');
// Логируем ошибку
logger.error(`Error: ${err.message}`, {
stack: err.stack,