Skip to content

Commit

Permalink
Additional error check.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Dec 18, 2024
1 parent 1d285eb commit 4d4b5de
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions clients/bigquery/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,13 @@ func (s *Store) putTable(ctx context.Context, bqTableID dialect.TableIdentifier,
return fmt.Errorf("failed to append rows: %w", err)
}

if resp, err := result.FullResponse(ctx); err != nil {
return fmt.Errorf("failed to get response (%s): %w", resp.GetError().String(), err)
resp, err := result.FullResponse(ctx)
if err != nil {
return fmt.Errorf("failed to get response: %w", err)
}

if status := resp.GetError(); status != nil {
return fmt.Errorf("failed to append rows: %s", status.String())
}

return nil
Expand Down

0 comments on commit 4d4b5de

Please sign in to comment.