public GrpcExceptionServerStreamingCallable( ServerStreamingCallable<RequestT, ResponseT> inner, Set<Code> retryableCodes) { this.inner = inner; this.exceptionFactory = new GrpcApiExceptionFactory(retryableCodes); }
@Override protected void onErrorImpl(Throwable t) { if (cancellationException != null) { t = cancellationException; } else { t = exceptionFactory.create(t); } innerObserver.onError(t); }
@Override protected void onErrorImpl(Throwable t) { if (cancellationException != null) { t = cancellationException; } else { t = exceptionFactory.create(t); } innerObserver.onError(t); }
GrpcExceptionBidiStreamingCallable( BidiStreamingCallable<RequestT, ResponseT> innerCallable, Set<StatusCode.Code> retryableCodes) { this.innerCallable = innerCallable; this.exceptionFactory = new GrpcApiExceptionFactory(retryableCodes); }
@Override public void onError(Throwable t) { innerObserver.onError(exceptionFactory.create(t)); }
GrpcExceptionBidiStreamingCallable( BidiStreamingCallable<RequestT, ResponseT> innerCallable, Set<StatusCode.Code> retryableCodes) { this.innerCallable = innerCallable; this.exceptionFactory = new GrpcApiExceptionFactory(retryableCodes); }
@Override public void onError(Throwable t) { innerObserver.onError(exceptionFactory.create(t)); }
public GrpcExceptionServerStreamingCallable( ServerStreamingCallable<RequestT, ResponseT> inner, Set<Code> retryableCodes) { this.inner = inner; this.exceptionFactory = new GrpcApiExceptionFactory(retryableCodes); }
ApiException create(Throwable throwable) { if (throwable instanceof StatusException) { StatusException e = (StatusException) throwable; return create(throwable, e.getStatus().getCode()); } else if (throwable instanceof StatusRuntimeException) { StatusRuntimeException e = (StatusRuntimeException) throwable; return create(throwable, e.getStatus().getCode()); } else if (throwable instanceof ApiException) { return (ApiException) throwable; } else { // Do not retry on unknown throwable, even when UNKNOWN is in retryableCodes return ApiExceptionFactory.createException( throwable, GrpcStatusCode.of(Status.Code.UNKNOWN), false); } }
GrpcExceptionClientStreamingCallable( ClientStreamingCallable<RequestT, ResponseT> innerCallable, Set<StatusCode.Code> retryableCodes) { this.innerCallable = innerCallable; this.exceptionFactory = new GrpcApiExceptionFactory(retryableCodes); }
ApiException create(Throwable throwable) { if (throwable instanceof StatusException) { StatusException e = (StatusException) throwable; return create(throwable, e.getStatus().getCode()); } else if (throwable instanceof StatusRuntimeException) { StatusRuntimeException e = (StatusRuntimeException) throwable; return create(throwable, e.getStatus().getCode()); } else if (throwable instanceof ApiException) { return (ApiException) throwable; } else { // Do not retry on unknown throwable, even when UNKNOWN is in retryableCodes return ApiExceptionFactory.createException( throwable, GrpcStatusCode.of(Status.Code.UNKNOWN), false); } }
GrpcExceptionClientStreamingCallable( ClientStreamingCallable<RequestT, ResponseT> innerCallable, Set<StatusCode.Code> retryableCodes) { this.innerCallable = innerCallable; this.exceptionFactory = new GrpcApiExceptionFactory(retryableCodes); }
GrpcExceptionCallable( UnaryCallable<RequestT, ResponseT> callable, Set<StatusCode.Code> retryableCodes) { this.callable = Preconditions.checkNotNull(callable); this.exceptionFactory = new GrpcApiExceptionFactory(retryableCodes); }
GrpcExceptionCallable( UnaryCallable<RequestT, ResponseT> callable, Set<StatusCode.Code> retryableCodes) { this.callable = Preconditions.checkNotNull(callable); this.exceptionFactory = new GrpcApiExceptionFactory(retryableCodes); }