Skip to content
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

Confusing error message in case of Http requests timeout parameter out of range #1361

Open
abalarev opened this issue Apr 11, 2022 · 4 comments

Comments

@abalarev
Copy link
Contributor

When using http request with parameter timeout, currently the parameter units are seconds in range 0-60.
If a value passed is out of range (for example timeout=90), the response error message says The timeout <90 000ms> is not inside its allowed bounds <0ms - 60 000ms>, which is incorrect. The message should give the range and the units in seconds (instead of in milliseconds)

@abalarev abalarev changed the title Http requests timeout parameter range Http requests timeout parameter range is incorrect Apr 11, 2022
@thjaeckle
Copy link
Member

What is incorrect here?
When the unit is omitted from the timeout parameter, it is treated as s (seconds) - so 90 000ms is the correct interpretation into ms.
You could also specify e.g. a timeout=1337ms instead.

For simplicity, the exception always uses ms as unit for its description text.

@abalarev
Copy link
Contributor Author

Actually the values are correct, maybe it's a bit confusing to specify seconds by default and receive a response message in milliseconds instead. I didn't know ms could be specified explicitly.
I could close the issue if this behaviour is the desired one.

@thjaeckle
Copy link
Member

Yes, it is not "incorrect" - it could be more convenient to get the unit in the exception text which was passed in.
If you want to contribute that improvement, we are open to accept a PR improving that 😃

@abalarev
Copy link
Contributor Author

I would like to do that as my first contribution, so I'll keep the issue open.

@abalarev abalarev changed the title Http requests timeout parameter range is incorrect Confusing error message in case of Http requests timeout parameter out of range Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants