1
0

💥 Remove try/catch from timeout

Call to this method should now be surrounded by try catch
This commit is contained in:
2022-01-05 19:40:28 +01:00
parent 1b48261b94
commit 190d7f7d26
2 changed files with 6 additions and 6 deletions

View File

@@ -15,11 +15,7 @@ async function timeout(
reason = "";
}
try {
await chatClient.timeout(channel, username, time, reason);
} catch (e) {
// user cannot be timed out
}
}
export { timeout };

View File

@@ -57,7 +57,11 @@ async function handleClientAction(action: Action): Promise<void> {
say(channel, action.data.message);
break;
case ActionType.Timeout:
try {
await timeout(channel, username, action.data.time, action.data.reason);
} catch (e) {
// user cannot be timed out
}
break;
case ActionType.Broadcast:
broadcast(action.data.message);