fix closed error type (#99)

This commit is contained in:
Jacek Sieka 2020-05-13 21:45:40 +02:00 committed by GitHub
parent 357baa52a0
commit aff69aaf29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -467,11 +467,11 @@ proc windowsAnyAddressFix*(a: TransportAddress): TransportAddress {.inline.} =
template checkClosed*(t: untyped) =
if (ReadClosed in (t).state) or (WriteClosed in (t).state):
raise newException(TransportError, "Transport is already closed!")
raise newException(TransportUseClosedError, "Transport is already closed!")
template checkClosed*(t: untyped, future: untyped) =
if (ReadClosed in (t).state) or (WriteClosed in (t).state):
future.fail(newException(TransportError, "Transport is already closed!"))
future.fail(newException(TransportUseClosedError, "Transport is already closed!"))
return future
template checkWriteEof*(t: untyped, future: untyped) =