bump 0.5.26 — fix server.js error handler to show message
This commit is contained in:
@@ -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));
|
||||
});
|
||||
|
||||
// ── Старт сервера ─────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user