Skip to content

Commit 13299fe

Browse files
committed
Simplify amending message on job result error
All GoogleAPICallError (GoogleCloudError) instances have the "message" attribute, even in Python 3, thus the additional info can be appended directly to that attribute.
1 parent 92ad0cb commit 13299fe

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • bigquery/google/cloud/bigquery

‎bigquery/google/cloud/bigquery/job.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2913,9 +2913,8 @@ def result(self, timeout=None, page_size=None, retry=DEFAULT_RETRY):
29132913
self.job_id, retry, project=self.project, location=self.location
29142914
)
29152915
except exceptions.GoogleCloudError as exc:
2916-
new_msg = str(exc) + self._format_for_exception(self.query, self.job_id)
2917-
new_exc = type(exc)(new_msg)
2918-
raise six.raise_from(new_exc, exc)
2916+
exc.message += self._format_for_exception(self.query, self.job_id)
2917+
raise
29192918

29202919
# If the query job is complete but there are no query results, this was
29212920
# special job, such as a DDL query. Return an empty result set to

0 commit comments

Comments
 (0)