Skip to content

Commit

Permalink
Only show up to 5 examples in errors
Browse files Browse the repository at this point in the history
While testing #6 I realized that a CSV file with 150,000+ lines
results in incredibly long error  messages
  • Loading branch information
simonw committed Nov 12, 2021
1 parent 6d4d13c commit 482e199
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git_history/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def file(
if bad_items:
raise click.ClickException(
"Commit: {} - every item must have the --id keys. These items did not:\n{}".format(
git_hash, json.dumps(bad_items, indent=4, default=str)
git_hash, json.dumps(bad_items[:5], indent=4, default=str)
)
)
# Also ensure there are not TWO items in this file with the same ID
Expand All @@ -181,7 +181,7 @@ def file(
dict((id, item.get(id)) for id in fixed_ids)
)
== item_id
],
][:5],
indent=4,
default=str,
),
Expand Down

0 comments on commit 482e199

Please sign in to comment.