File tree Expand file tree Collapse file tree 3 files changed +9
-13
lines changed
google-cloud-bigquery/src
main/java/com/google/cloud/bigquery
test/java/com/google/cloud/bigquery Expand file tree Collapse file tree 3 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -403,9 +403,7 @@ public Job reload(JobOption... options) {
403403 checkNotDryRun ("reload" );
404404 Job job = bigquery .getJob (getJobId (), options );
405405 if (job != null && job .getStatus ().getError () != null ) {
406- // TODO(pmakani): change to BigQueryException when fast query path change is merged
407- throw new JobException (
408- getJobId (),
406+ throw new BigQueryException (
409407 job .getStatus ().getExecutionErrors () == null
410408 ? ImmutableList .of (job .getStatus ().getError ())
411409 : ImmutableList .copyOf (job .getStatus ().getExecutionErrors ()));
Original file line number Diff line number Diff line change @@ -447,12 +447,12 @@ public void testReloadJobException() {
447447 expectedJob =
448448 expectedJob .toBuilder ().setStatus (new JobStatus (State .DONE , bigQueryError , null )).build ();
449449 ImmutableList <BigQueryError > bigQueryErrorList = ImmutableList .of (bigQueryError );
450- JobException jobException = new JobException ( expectedJob . getJobId (), bigQueryErrorList );
451- when (bigquery .getJob (JOB_INFO .getJobId ())).thenReturn (expectedJob ).thenThrow (jobException );
450+ BigQueryException bigQueryException = new BigQueryException ( bigQueryErrorList );
451+ when (bigquery .getJob (JOB_INFO .getJobId ())).thenReturn (expectedJob ).thenThrow (bigQueryException );
452452 try {
453453 job .reload ();
454454 fail ("JobException expected" );
455- } catch (JobException e ) {
455+ } catch (BigQueryException e ) {
456456 assertNotNull (e .getErrors ());
457457 }
458458 }
Original file line number Diff line number Diff line change 6565import com .google .cloud .bigquery .InsertAllRequest ;
6666import com .google .cloud .bigquery .InsertAllResponse ;
6767import com .google .cloud .bigquery .Job ;
68- import com .google .cloud .bigquery .JobException ;
6968import com .google .cloud .bigquery .JobId ;
7069import com .google .cloud .bigquery .JobInfo ;
7170import com .google .cloud .bigquery .JobStatistics ;
@@ -1493,12 +1492,11 @@ public void testMultipleStatementsQueryException() throws InterruptedException {
14931492 try {
14941493 bigquery .create (JobInfo .of (QueryJobConfiguration .of (invalidQuery ))).waitFor ();
14951494 fail ("JobException was expected" );
1496- } catch (JobException e ) {
1497- for (BigQueryError error : e .getErrors ()) {
1498- assertNotNull (error );
1499- assertEquals ("invalidQuery" , error .getReason ());
1500- assertNotNull (error .getMessage ());
1501- }
1495+ } catch (BigQueryException e ) {
1496+ BigQueryError error = e .getError ();
1497+ assertNotNull (error );
1498+ assertEquals ("invalidQuery" , error .getReason ());
1499+ assertNotNull (error .getMessage ());
15021500 }
15031501 }
15041502
You can’t perform that action at this time.
0 commit comments