File tree Expand file tree Collapse file tree
java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 */
1616package com .google .cloud .bigquery ;
1717
18+ import com .google .api .client .http .HttpResponseException ;
1819import com .google .api .core .ApiClock ;
1920import com .google .api .gax .retrying .DirectRetryingExecutor ;
2021import com .google .api .gax .retrying .ExponentialRetryAlgorithm ;
@@ -69,8 +70,16 @@ public static <V> V runWithRetries(
6970 // implementation does not use response at all, so ignoring its type is ok.
7071 @ SuppressWarnings ("unchecked" )
7172 ResultRetryAlgorithm <V > algorithm = (ResultRetryAlgorithm <V >) resultRetryAlgorithm ;
73+ Callable <V > translatingCallable =
74+ () -> {
75+ try {
76+ return callable .call ();
77+ } catch (HttpResponseException e ) {
78+ throw new BigQueryException (e );
79+ }
80+ };
7281 return run (
73- callable ,
82+ translatingCallable ,
7483 new ExponentialRetryAlgorithm (retrySettings , clock ),
7584 algorithm ,
7685 bigQueryRetryConfig );
You can’t perform that action at this time.
0 commit comments