Skip to content

Commit

Permalink
fix error handling in big_query_utils.insert_rows
Browse files Browse the repository at this point in the history
  • Loading branch information
jtattermusch committed Apr 15, 2016
1 parent 92265f6 commit ac4251a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/gcp/utils/big_query_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,13 @@ def insert_rows(big_query, project_id, dataset_id, table_id, rows_list):
tableId=table_id,
body=body)
res = insert_req.execute(num_retries=NUM_RETRIES)
if res.get('insertErrors', None):
print 'Error inserting rows! Response: %s' % res
is_success = False
except HttpError as http_error:
print 'Error in inserting rows in the table %s' % table_id
print 'Error inserting rows to the table %s' % table_id
is_success = False

return is_success


Expand Down

0 comments on commit ac4251a

Please sign in to comment.