chore: log real processing error + show compact reason (debug phase)
This commit is contained in:
+5
-1
@@ -119,7 +119,11 @@ export async function processItem(itemId: string): Promise<ProcessResult> {
|
||||
|
||||
return { ok: true, cost };
|
||||
} catch (e: any) {
|
||||
const msg = e?.friendly || e?.message || 'Unbekannter Fehler';
|
||||
const real = e?.message || String(e);
|
||||
const status = e?.status ? ` [status ${e.status}]` : '';
|
||||
console.error(`[process] Item ${itemId} fehlgeschlagen${status}: ${real}`, e?.stack || '');
|
||||
// Nutzeranzeige: freundlich, aber mit kompaktem Grund fürs Debugging in dieser Phase
|
||||
const msg = (e?.friendly ? `${e.friendly}` : real) + (e?.status ? ` (${e.status})` : '');
|
||||
await query(`UPDATE items SET status='failed', error_message=$2 WHERE id=$1`,
|
||||
[itemId, String(msg).slice(0, 500)]);
|
||||
// 402/Guthaben: nach oben durchreichen, damit der Worker den Auftrag anhält
|
||||
|
||||
Reference in New Issue
Block a user