This results in two casts. Perhaps:

```
var webException = ex as WebException;
if (webException != null && webException.Status == WebExceptionStatus.RequestCancelled)...
```