@Override public Observable<T> call(Throwable e) { if (e instanceof RuntimeException) { return Observable.error(exceptionTranslator.translateExceptionIfPossible((RuntimeException) e)); } else if (e instanceof TimeoutException) { return Observable.error(new QueryTimeoutException(e.getMessage(), e)); } else if (e instanceof InterruptedException) { return Observable.error(new OperationInterruptedException(e.getMessage(), e)); } else if (e instanceof ExecutionException) { return Observable.error(new OperationInterruptedException(e.getMessage(), e)); } else { return Observable.error(e); } } });
@Override public Observable<T> call(Throwable e) { if (e instanceof RuntimeException) { return Observable.error(exceptionTranslator.translateExceptionIfPossible((RuntimeException) e)); } else if (e instanceof TimeoutException) { return Observable.error(new QueryTimeoutException(e.getMessage(), e)); } else if (e instanceof InterruptedException) { return Observable.error(new OperationInterruptedException(e.getMessage(), e)); } else if (e instanceof ExecutionException) { return Observable.error(new OperationInterruptedException(e.getMessage(), e)); } else { return Observable.error(e); } } });
public static Observable translateError(Throwable e) { if (e instanceof RuntimeException) { return Observable.error(exceptionTranslator.translateExceptionIfPossible((RuntimeException) e)); } else if(e instanceof TimeoutException) { return Observable.error(new QueryTimeoutException(e.getMessage(), e)); } else if(e instanceof InterruptedException) { return Observable.error(new OperationInterruptedException(e.getMessage(), e)); } else if(e instanceof ExecutionException) { return Observable.error(new OperationInterruptedException(e.getMessage(), e)); } else { return Observable.error(e); } } }
public static Observable translateError(Throwable e) { if (e instanceof RuntimeException) { return Observable.error(exceptionTranslator.translateExceptionIfPossible((RuntimeException) e)); } else if(e instanceof TimeoutException) { return Observable.error(new QueryTimeoutException(e.getMessage(), e)); } else if(e instanceof InterruptedException) { return Observable.error(new OperationInterruptedException(e.getMessage(), e)); } else if(e instanceof ExecutionException) { return Observable.error(new OperationInterruptedException(e.getMessage(), e)); } else { return Observable.error(e); } } }
@Override public <T> T execute(BucketCallback<T> action) { try { return action.doInBucket(); } catch (RuntimeException e) { throw exceptionTranslator.translateExceptionIfPossible(e); } catch (TimeoutException e) { throw new QueryTimeoutException(e.getMessage(), e); } catch (InterruptedException e) { throw new OperationInterruptedException(e.getMessage(), e); } catch (ExecutionException e) { throw new OperationInterruptedException(e.getMessage(), e); } }
@Override public <T> T execute(BucketCallback<T> action) { try { return action.doInBucket(); } catch (RuntimeException e) { throw exceptionTranslator.translateExceptionIfPossible(e); } catch (TimeoutException e) { throw new QueryTimeoutException(e.getMessage(), e); } catch (InterruptedException e) { throw new OperationInterruptedException(e.getMessage(), e); } catch (ExecutionException e) { throw new OperationInterruptedException(e.getMessage(), e); } }