From 3630005e19e3fdb1f72b44128c30bf88ebf2cf2d Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Wed, 17 Jun 2020 23:50:17 -0500 Subject: [PATCH] Simplify creation of IOError exception --- src/client.nim | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/client.nim b/src/client.nim index d622c66..549f263 100644 --- a/src/client.nim +++ b/src/client.nim @@ -90,10 +90,7 @@ proc startConnection*(client: DiscordClient) {.async.} = asyncCheck client.handleWebsocketPacket() runForever() else: - var e: ref IOError - new(e) - e.msg = "Failed to get gateway url, token may of been incorrect!" - raise e + raise newException(IOError, "Failed to get gateway url, token may of been incorrect!") proc newDiscordClient(tkn: string): DiscordClient = globalToken = tkn