ditto
ditto copied to clipboard
Confusing error message in case of Http requests `timeout` parameter out of range
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)
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.
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.
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 😃
I would like to do that as my first contribution, so I'll keep the issue open.