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:
LTS20050703
2022-10-01 12:14:59 -04:00
committed by GitHub
parent e410da016e
commit 39a806ff9c
11 changed files with 19 additions and 14 deletions
+1 -1
View File
@@ -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);
}