This commit is contained in:
2026-03-19 00:13:30 +01:00
parent 8de05d5552
commit 291ce9f0c7
3 changed files with 403 additions and 90 deletions

View File

@@ -21,6 +21,13 @@
if (!res.ok) {
throw new Error(data.error || `HTTP ${res.status}`);
}
if (data && data.results && typeof data.results === 'object') {
const failures = Object.values(data.results).filter((row) => row && row.ok === false);
if (failures.length) {
const first = failures[0];
throw new Error(first.error || 'action_failed');
}
}
return data;
};