If already using an `is` check, why not use logic like

```
CloudException cex = ex as CloudException;
if (ex != null) {
    // logic?
}
```