Skip to content

withTimeout() should throw TimeoutCancellationException if timeMillis<= 0 #870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
baltiyskiy opened this issue Dec 3, 2018 · 0 comments
Closed
Labels

Comments

@baltiyskiy
Copy link

Documentation for withTimeout states that it throws a TimeoutCancellationException if the timeout was exceeded. However, the implementation throws a CancellationException if timeMillis <= 0. First, it looks like the implementation directly violates the documentation, because that's a case of an already exceeded timeout. Second, there's no notice of CancellationException in the docs altogether. Third, it makes no sense to state that the method throws a DerivedException when it throws BaseException, because one has to catch BaseException instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants