Skip to content

Commit 1f5ce6e

Browse files
author
gui_talarico
committed
Add error info
1 parent a14dba8 commit 1f5ce6e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

airtable/airtable.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,13 @@ def _build_batch_record_objects(self, records):
165165
return [{"fields": record} for record in records]
166166

167167
def _process_response(self, response):
168-
""" Pass through exception so we can check status"""
169-
response.raise_for_status()
168+
""" Pass through exception so we can check status, inject error"""
169+
try:
170+
response.raise_for_status()
171+
except requests.HTTPError as exc:
172+
## TODO should inject only in certain error codes?
173+
exc.args = (*exc.args, exc.response.json())
174+
raise
170175
return response.json()
171176

172177
def record_url(self, record_id):

0 commit comments

Comments
 (0)