Handle TaskCanceled exception and re-throw it with timeout exception
@@ -172,6 +172,11 @@ public virtual Response Execute(Command commandToExecute)
string unknownErrorMessage = "An unknown exception was encountered sending an HTTP request to the remote WebDriver server for URL {0}. The exception message was: {1}";
throw new WebDriverException(string.Format(CultureInfo.InvariantCulture, unknownErrorMessage, requestInfo.FullUri.AbsoluteUri, ex.Message), ex);
}
+ catch(TaskCanceledException ex)
+ {
+ string timeoutMessage = "The HTTP request to the remote WebDriver server for URL {0} timed out after {1} seconds.";
+ throw new WebDriverException(string.Format(CultureInfo.InvariantCulture, timeoutMessage, requestInfo.FullUri.AbsoluteUri, this.serverResponseTimeout.TotalSeconds), ex);
+ }
Response toReturn = this.CreateResponse(responseInfo);
return toReturn;
