You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Moved from Codeplex: https://gw2dotnet.codeplex.com/workitem/1216]
When a timeout occurs, the default behavior is to throw a System.Net.WebException. Would it make sense to throw a System.TimeoutException instead? Timeouts are not as extreme as most other transport errors, and are usually caused by network congestion instead of a bad network configuration.
Ruhrpottpatriot wrote Aug 10, 2014 at 8:10 AM
I think it'd be best to throw a WebException with a TimeoutException being the inner exception
StevenLiekens wrote Aug 10, 2014 at 9:05 AM
We can't throw a new WebException and also preserve the original exception details that were generated by the framework. But we can catch the source WebException and wrap it in a new TimeoutException. So client code would look like this:
try{// Talk to the service service.GetBuild();}catch(ServiceExceptionex){// Handle errors generated by the server}catch(TimeoutExceptionex){// Handle timeouts}catch(WebExceptionex){// Handle fatal errors}
The text was updated successfully, but these errors were encountered:
[Moved from Codeplex: https://gw2dotnet.codeplex.com/workitem/1216]
When a timeout occurs, the default behavior is to throw a System.Net.WebException. Would it make sense to throw a System.TimeoutException instead? Timeouts are not as extreme as most other transport errors, and are usually caused by network congestion instead of a bad network configuration.
Ruhrpottpatriot wrote Aug 10, 2014 at 8:10 AM
StevenLiekens wrote Aug 10, 2014 at 9:05 AM
The text was updated successfully, but these errors were encountered: