Skip to content

Commit

Permalink
Improve error message when issue data structure is unexpected.
Browse files Browse the repository at this point in the history
Provides more diagnostics for #54.
  • Loading branch information
Sam Minnee committed Jan 22, 2019
1 parent 1e55d51 commit d3d3192
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tap_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ def get_all_issues(schema, repo_path, state, mdata):
issues = response.json()
extraction_time = singer.utils.now()
for issue in issues:
if not isinstance(issue, dict):
raise TypeError('Unexpected response from issues API: ' + response.text)

issue['_sdc_repository'] = repo_path
with singer.Transformer() as transformer:
rec = transformer.transform(issue, schema, metadata=metadata.to_map(mdata))
Expand Down

0 comments on commit d3d3192

Please sign in to comment.