mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix: errors (#2496)
* fix: errors * fix: err can be undefined * tests: fix sticker tests * fix: create channel require name * fix: sticker helpers and tests * tests: delete channel after tested guild stickers
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ export async function runMethod<T = any>(
|
||||
if (!result.ok) {
|
||||
const err = await result.json().catch(() => {});
|
||||
// Legacy Handling to not break old code or when body is missing
|
||||
if (!err.body) throw new Error(`Error: ${err.message ?? result.statusText}`);
|
||||
if (!err?.body) throw new Error(`Error: ${err.message ?? result.statusText}`);
|
||||
throw rest.convertRestError(errorStack, err);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user