mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-27 23:25:22 -04:00
fix: show backend error detail in context-popup compact button (#2721)
When the context-popup compact button receives a non-OK response (e.g. 409 for active-run), the error detail from the backend was being discarded in favor of a generic 'Compaction failed' message. Now parses the JSON response body for non-OK responses and prefers the detail field when present, matching the behavior of the /compact slash command. Uses textContent for safe rendering. Co-authored-by: michaelxer <michaelxer@users.noreply.github.com>
This commit is contained in:
@@ -1877,7 +1877,13 @@ export function displayMetrics(messageElement, metrics) {
|
|||||||
}
|
}
|
||||||
}, 200);
|
}, 200);
|
||||||
} else {
|
} else {
|
||||||
compactBody.innerHTML = '<span style="color:var(--red);">Compaction failed. Try again later.</span>';
|
let detail = 'Compaction failed. Try again later.';
|
||||||
|
try {
|
||||||
|
const err = await res.json();
|
||||||
|
if (err.detail) detail = err.detail;
|
||||||
|
} catch {}
|
||||||
|
compactBody.textContent = detail;
|
||||||
|
compactBody.style.color = 'var(--red)';
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
clearInterval(waveInterval);
|
clearInterval(waveInterval);
|
||||||
|
|||||||
Reference in New Issue
Block a user