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.
introduce raising constraints on stream callbacks - these constraints now give a warning when called with a callback that can raise exceptions (raising callbacks would crash chronos)
fix fail and its tests, which wasn't always given a good generic match
work around nim bugs related to macro expansion of generic types
make sure transports raise only TransportError-derived exceptions (and CancelledError)
With these fixes, transports correctly propagate and document their raises information - generally, most transport functions (
send
etc) raiseTransportError
andCancelledError
-closeWait
is special in that it generally doesn't fail.This PR introduces the syntax
Future[void].Raises([types])
to create theInternalRaisesFuture
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.fail
and its tests, which wasn't always given a good generic matchTransportError
-derived exceptions (andCancelledError
)