Improve error handling App will no longer crash, if the error response cannot be parsed (e.g. when API is down).
1 files changed, 5 insertions(+), 1 deletions(-) M app.ts
M app.ts => app.ts +5 -1
@@ 122,7 122,11 @@ async function message_id(teamspeakID: string, msg: string) { } function get_error(e: unknown): string { return JSON.parse(JSON.stringify(e)).response.errors[0].message; try { return JSON.parse(JSON.stringify(e)).response.errors[0].message; } catch { return e as string; } } async function request(query: string, variables?: Variables): Promise<any> {