fallback for better debugging, for now

This commit is contained in:
Sorunome 2020-03-28 10:41:37 +01:00
parent bce6e78245
commit 0410f54df2
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C

View File

@ -185,6 +185,7 @@ export class Skype {
const MINUTE = 60000; const MINUTE = 60000;
client.on("error", async (err: Error) => { client.on("error", async (err: Error) => {
log.error("Error when polling"); log.error("Error when polling");
log.error(err.name);
log.error(err); log.error(err);
if (err.name === "UnexpectedHttpStatus") { if (err.name === "UnexpectedHttpStatus") {
await this.puppet.sendStatusMessage(puppetId, "Error: " + err); await this.puppet.sendStatusMessage(puppetId, "Error: " + err);
@ -193,6 +194,10 @@ export class Skype {
setTimeout(async () => { setTimeout(async () => {
await this.startClient(puppetId); await this.startClient(puppetId);
}, MINUTE); }, MINUTE);
} else {
log.error("baaaad error");
await this.puppet.sendStatusMessage(puppetId, "Super bad error, stopping puppet. Please restart the service to start it up again. This is for debugging purposes and will not be needed in the future");
await this.stopClient(puppetId);
} }
}); });
try { try {