diff options
| -rw-r--r-- | src/popup/popup.ts | 5 |
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 }; |
