status-im / nim-chronos

Chronos - An efficient library for asynchronous programming
https://status-im.github.io/nim-chronos/docs/chronos
Apache License 2.0
353 stars 51 forks source link

introduce asyncraises in transports/asyncsync #470

Closed arnetheduck closed 10 months ago

arnetheduck commented 10 months ago

With these fixes, transports correctly propagate and document their raises information - generally, most transport functions (send etc) raise TransportError and CancelledError - closeWait is special in that it generally doesn't fail.

This PR introduces the syntax Future[void].Raises([types]) to create the InternalRaisesFuture type with the correct encoding for the types - this allows it to be used in user code while retaining the possibility to change the internal representation down the line.