Instead of doing the instanceof check here can we maybe wrap the body of the try / catch in another try catch and then rethrow? like this:

```
try {
  try {


  } catch (WriteFailure e) {


  }
} catch (Throwable e) {
  // do all the things
  throw e.getCause(); // maybe check if e.getCause() can be null?
}