mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: surface hidden errors and add batch rejection tests
Fix empty catch blocks in settings dialog (logo upload/delete) and automate page (pipeline save) that silently swallowed errors. Users now see error messages when these operations fail. Add 5 integration tests verifying batch endpoint returns 404 for custom-route tools (remove-background, upscale, ocr, blur-faces, erase-object), matching the pipeline rejection tests.
This commit is contained in:
@@ -295,7 +295,7 @@ function SystemSection() {
|
||||
});
|
||||
setSettings((prev) => ({ ...prev, customLogo: "true" }));
|
||||
} catch {
|
||||
/* handle error */
|
||||
setSaveMsg("Failed to upload logo.");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -304,7 +304,7 @@ function SystemSection() {
|
||||
await apiDelete("/v1/settings/logo");
|
||||
setSettings((prev) => ({ ...prev, customLogo: "false" }));
|
||||
} catch {
|
||||
/* handle error */
|
||||
setSaveMsg("Failed to delete logo.");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -66,9 +66,12 @@ export function AutomatePage() {
|
||||
});
|
||||
if (res.ok) {
|
||||
await loadPipelines();
|
||||
} else {
|
||||
const data = await res.json().catch(() => ({}));
|
||||
setExecutionError(data.error || "Failed to save pipeline");
|
||||
}
|
||||
} catch {
|
||||
// Error handling could be added
|
||||
setExecutionError("Connection error while saving pipeline.");
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user