Simplify creation of IOError exception
This commit is contained in:
parent
38c25b670d
commit
3630005e19
|
@ -90,10 +90,7 @@ proc startConnection*(client: DiscordClient) {.async.} =
|
||||||
asyncCheck client.handleWebsocketPacket()
|
asyncCheck client.handleWebsocketPacket()
|
||||||
runForever()
|
runForever()
|
||||||
else:
|
else:
|
||||||
var e: ref IOError
|
raise newException(IOError, "Failed to get gateway url, token may of been incorrect!")
|
||||||
new(e)
|
|
||||||
e.msg = "Failed to get gateway url, token may of been incorrect!"
|
|
||||||
raise e
|
|
||||||
|
|
||||||
proc newDiscordClient(tkn: string): DiscordClient =
|
proc newDiscordClient(tkn: string): DiscordClient =
|
||||||
globalToken = tkn
|
globalToken = tkn
|
||||||
|
|
Reference in New Issue