aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-09-24 21:02:27 +0530
committerBobby <[email protected]>2025-09-24 21:02:27 +0530
commitbdb36b9c1a40f0c9be22676cf590e242d3327147 (patch)
treec0c20a32399ae8a0efeb566d669edc97f832120a
parent761c734cec7af964ed6c90c578220e03cf0524f8 (diff)
downloadthunderbird-ai-compose-bdb36b9c1a40f0c9be22676cf590e242d3327147.tar.xz
thunderbird-ai-compose-bdb36b9c1a40f0c9be22676cf590e242d3327147.zip
update popup error message
-rw-r--r--src/popup/popup.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/popup/popup.ts b/src/popup/popup.ts
index f849dcd..d781c5e 100644
--- a/src/popup/popup.ts
+++ b/src/popup/popup.ts
@@ -102,7 +102,10 @@ async function handleInsert(): Promise<void> {
});
if (!res.ok) {
- throw new Error(`Server responded with ${res.status}`);
+ const error = await res.json().catch(() => null);
+ throw new Error(
+ `Server responded with ${res.status}. Error: ${error?.error || res.statusText}`
+ );
}
const data: { response?: string } = (await res.json()) as { response?: string };