When making an API call, if the request times out, there is no exception propagated to the caller. Instead a default value, depending on the method's signature, is returned. For example, UserApi.GetUserAsync(string) will return null. UserApi.ListUsers() will return an empty list once you enumerate it.
I am not sure if this is a bug or by design so I would appreciate a little bit of clarity. An API call that returns null can possibly be used to detect a connection timeout but something like an empty list makes this very difficult to detect. I have a scenario where I need to tell the difference between the API not finding any data and the API actually failing because of a transient connection error.
Thanks in advance.
What is expected to happen?
Any API call, such as UserApi.GetUserAsync(string) , should throw an exception if there is a connection timeout. Not trap it.
What is the actual behavior?
The exception is trapped.
Reproduction Steps?
Create a UserApi instance. Use a dummy proxy (i.e. a non existent proxy address) to simulate a connection timeout
Call UserApi.ListUsers() and enumerate the list
An empty list is returned because of the connection timeout
Describe the bug?
When making an API call, if the request times out, there is no exception propagated to the caller. Instead a default value, depending on the method's signature, is returned. For example,
UserApi.GetUserAsync(string)
will returnnull
.UserApi.ListUsers()
will return an empty list once you enumerate it.I am not sure if this is a bug or by design so I would appreciate a little bit of clarity. An API call that returns
null
can possibly be used to detect a connection timeout but something like an empty list makes this very difficult to detect. I have a scenario where I need to tell the difference between the API not finding any data and the API actually failing because of a transient connection error.Thanks in advance.
What is expected to happen?
Any API call, such as
UserApi.GetUserAsync(string)
, should throw an exception if there is a connection timeout. Not trap it.What is the actual behavior?
The exception is trapped.
Reproduction Steps?
UserApi
instance. Use a dummy proxy (i.e. a non existent proxy address) to simulate a connection timeoutUserApi.ListUsers()
and enumerate the listAdditional Information?
No response
.NET Version
7.0.201
SDK Version
6.0.7
OS version
No response