From fe939b6d04608a8685aa68e933f744412e9f4f72 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Sun, 29 Mar 2020 11:53:30 +0200 Subject: [PATCH] hopefully properly catch this --- src/skype.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/skype.ts b/src/skype.ts index 9a9003f..ed29067 100644 --- a/src/skype.ts +++ b/src/skype.ts @@ -184,6 +184,7 @@ export class Skype { }); const MINUTE = 60000; client.on("error", async (err: Error) => { + const causeName = (err as any).cause ? (err as any).cause.name : ""; log.error("Error when polling"); log.error("name: ", err.name); const errr = err as any; @@ -195,7 +196,7 @@ export class Skype { log.error("cause: ", errr.cause); log.error("data: ", errr.data); log.error(err); - if (err.name === "UnexpectedHttpStatus") { + if (causeName === "UnexpectedHttpStatus") { await this.puppet.sendStatusMessage(puppetId, "Error: " + err); await this.puppet.sendStatusMessage(puppetId, "Reconnecting in a minute... "); await this.stopClient(puppetId);