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

dedicated exceptions for `Future.read` failures #474

Closed arnetheduck closed 10 months ago

arnetheduck commented 10 months ago

Dedicated exceptions for read failures reduce the risk of mixing up "user" exceptions with those of Future itself. The risk still exists, if the user allows a chronos exception to bubble up explicitly.

Because await structurally guarantees that the Future is not pending at the time of read, it does not raise this new exception.