When the request timeout is set, and it expires, the cancellation is handled by the client so it sets the correct response status to ResponseStatus.TimedOut. However, the HttpClient timeout produces an exception, which is not handled by AddError, so the request gets the status ResponseStatus.Error.
The solution is to change the AddError function to handle the HttpClient timeout exception, and set the response status properly.
When the request timeout is set, and it expires, the cancellation is handled by the client so it sets the correct response status to
ResponseStatus.TimedOut. However, theHttpClienttimeout produces an exception, which is not handled byAddError, so the request gets the statusResponseStatus.Error.The solution is to change the
AddErrorfunction to handle theHttpClienttimeout exception, and set the response status properly.