Skip to content

Commit

Permalink
Added more human-readable error message for invalid frames for range/…
Browse files Browse the repository at this point in the history
…span (arrow-py#407)

* Added more human-readable error message for invalid frames for range/span

* Fixed empty field name for string interpolation in range/span error message
  • Loading branch information
wonderb0lt authored and andrewelkins committed Jan 24, 2017
1 parent 93f4890 commit a78bb2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arrow/arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,8 @@ def _get_frames(cls, name):
elif name in ['quarter', 'quarters']:
return 'quarter', 'months', 3

raise AttributeError()
supported = ', '.join(cls._ATTRS + ['week', 'weeks'] + ['quarter', 'quarters'])
raise AttributeError('range/span over frame {0} not supported. Supported frames: {1}'.format(name, supported))

@classmethod
def _get_iteration_params(cls, end, limit):
Expand Down

0 comments on commit a78bb2f

Please sign in to comment.