This repository was archived by the owner on Mar 23, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
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 1818
1919import static com .google .common .base .Preconditions .checkNotNull ;
2020
21+ import com .google .api .client .json .GenericJson ;
2122import com .google .api .gax .retrying .ResultRetryAlgorithm ;
2223import com .google .api .gax .retrying .ResultRetryAlgorithmWithContext ;
2324import com .google .api .gax .retrying .RetryAlgorithm ;
@@ -223,6 +224,16 @@ private String getErrorDescFromResponse(ResponseT previousResponse) {
223224 known case where a response with status code 200 may contain an error message
224225 */
225226 try {
227+ if (previousResponse instanceof GenericJson ) {
228+ if (((GenericJson )previousResponse ).containsKey ("status" )){
229+ Object o1 = ((GenericJson )previousResponse ).get ("status" );
230+ if (o1 instanceof GenericJson && ((GenericJson )o1 ).containsKey ("errorResult" )){
231+ Object o2 = ((GenericJson )o1 ).get ("errorStatus" );
232+ return ((GenericJson )o2 ).get ("message" ).toString ();
233+ }
234+ }
235+ return null ;
236+ }
226237 JsonObject responseJson =
227238 JsonParser .parseString (previousResponse .toString ()).getAsJsonObject ();
228239 if (responseJson .has ("status" ) && responseJson .getAsJsonObject ("status" ).has ("errorResult" )) {
You can’t perform that action at this time.
0 commit comments