From 2815509c00bf5865f8fe9559f7e456d6455299ff Mon Sep 17 00:00:00 2001 From: V Date: Mon, 15 May 2023 02:49:34 +0200 Subject: UserScript: Fix fetch().res.ok --- src/plugins/translate/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/translate/utils.ts b/src/plugins/translate/utils.ts index 784ec25..493fb2c 100644 --- a/src/plugins/translate/utils.ts +++ b/src/plugins/translate/utils.ts @@ -59,7 +59,7 @@ export async function translate(kind: "received" | "sent", text: string): Promis const res = await fetch(url); if (!res.ok) throw new Error( - `Failed to translate "${text}" (${sourceLang} -> ${targetLang}` + `Failed to translate "${text}" (${sourceLang} -> ${targetLang})` + `\n${res.status} ${res.statusText}` ); -- cgit