aboutsummaryrefslogtreecommitdiff
path: root/src/client/Network.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-08-11 13:04:26 -0400
committerbobzel <zzzman@gmail.com>2025-08-11 13:04:26 -0400
commit5b0b7241e68febc2d0556b6c2e8349411b5c12a0 (patch)
treee4ee96e10ad16cff290f86108d160ec93575fc03 /src/client/Network.ts
parentb3aa4a5b0bbbb87d041b9515bddedbcbf8ae9fc5 (diff)
fixed image fill api to handler errors better.
Diffstat (limited to 'src/client/Network.ts')
-rw-r--r--src/client/Network.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/Network.ts b/src/client/Network.ts
index 850ab4f91..ff3f3d1af 100644
--- a/src/client/Network.ts
+++ b/src/client/Network.ts
@@ -38,7 +38,11 @@ export namespace Networking {
method: 'POST',
body: formData,
};
- return fetch('/queryFireflyImageFillWithMask', parameters);
+ return fetch('/queryFireflyImageFillWithMask', parameters).then(response => {
+ if (response.ok) return response.json() as object;
+
+ return response.text().then(text => ({ error: '' + response.status + ':' + response.statusText + '-' + text }));
+ });
}
/**