Simplify creation of IOError exception

This commit is contained in:
SeanOMik 2020-06-17 23:50:17 -05:00
parent 38c25b670d
commit 3630005e19
No known key found for this signature in database
GPG Key ID: FA4D55AC05268A88
1 changed files with 1 additions and 4 deletions

View File

@ -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