bump 0.5.26 — fix server.js error handler to show message

This commit is contained in:
2026-06-09 21:01:00 +04:00
parent 9c74479121
commit d0bfdab085
3 changed files with 7 additions and 5 deletions
+3 -2
View File
@@ -121,8 +121,9 @@ async function start() {
// ── Общий обработчик ошибок ───────────────────────────────────────────────
// eslint-disable-next-line no-unused-vars
app.use((err, req, res, next) => {
console.error('Unhandled error:', err);
res.status(500).send('Внутренняя ошибка сервера');
const msg = err instanceof Error ? (err.message || err.stack || String(err)) : JSON.stringify(err);
console.error('Unhandled error:', msg);
res.status(500).send('Ошибка: ' + msg.slice(0, 500));
});
// ── Старт сервера ─────────────────────────────────────────────────────────────