Skip to content

Commit

Permalink
fix: Throw TelnetError where it occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
schw4rzlicht committed Jun 14, 2020
1 parent 637e607 commit efb525a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/Twitch2Ma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default class Twitch2Ma extends EventEmitter {
this.chatClient.say(channel, reason.viewerMessage.replace("{command}", command));
this.emit(this.onPermissionDenied, channel, user, command, reason.name);
})
.catch(() => this.stopWithError(new TelnetError("Sending telnet command failed!")));
.catch(TelnetError, error => this.stopWithError(error)); // TODO catch sentry
}
}
}
Expand All @@ -187,6 +187,9 @@ export default class Twitch2Ma extends EventEmitter {
.then(() => {
if (_.isString(instructions.consoleCommand)) {
return this.telnet.send(instructions.consoleCommand)
.catch(() => {
throw new TelnetError("Sending telnet command failed!");
})
.then(() => this.permissionController.setAdditionalRuntimeInformation("lastCall", new Date().getTime()));
}
});
Expand Down

0 comments on commit efb525a

Please sign in to comment.