File tree 1 file changed +6
-4
lines changed
samples/snippets/src/main/java/com/example/bigquery
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,12 @@ public static void simpleApp(String projectId) {
67
67
// Check for errors
68
68
if (queryJob == null ) {
69
69
throw new RuntimeException ("Job no longer exists" );
70
- } else if (queryJob .getStatus ().getError () != null ) {
71
- // You can also look at queryJob.getStatus().getExecutionErrors() for all
72
- // errors, not just the latest one.
73
- throw new RuntimeException (queryJob .getStatus ().getError ().toString ());
70
+ } else if (queryJob .getStatus ().getExecutionErrors () != null
71
+ && queryJob .getStatus ().getExecutionErrors ().size () > 0 ) {
72
+ // TODO(developer): Handle errors here. An error here do not necessarily mean that the job
73
+ // has completed or was unsuccessful.
74
+ // For more details: https://cloud.google.com/bigquery/troubleshooting-errors
75
+ throw new RuntimeException ("An unhandled error has occurred" );
74
76
}
75
77
// [END bigquery_simple_app_query]
76
78
You can’t perform that action at this time.
0 commit comments