From f01ef02324a678d011642106af12dd448ff0c307 Mon Sep 17 00:00:00 2001 From: split Date: Thu, 21 Nov 2024 20:32:07 -0800 Subject: [PATCH] feat: add discord logging --- src/translators/discord.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/translators/discord.ts b/src/translators/discord.ts index c71ccae..c222e94 100644 --- a/src/translators/discord.ts +++ b/src/translators/discord.ts @@ -20,7 +20,7 @@ export default translator({ // copied from a firefox private browsing window // realistically this will probably need updates in the future // but for now this is good enough - await fetch("https://discord.com/api/v9/users/@me", { + let f = await fetch("https://discord.com/api/v9/users/@me", { headers: { "User-Agent": ua, Accept: "*/*", @@ -66,5 +66,10 @@ export default translator({ }), method: "PATCH", }) + + if (!f.ok) + throw new Error( + `discord: avatar set failed with ${f.status}: ${await f.text()}` + ) }, })