Skip to content

Commit

Permalink
Adds detail error messages for missing ion_type. (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheqianh committed Feb 4, 2021
1 parent a148825 commit f8c61fb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions amazon/ion/simpleion.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ def _dump(obj, writer, from_type, field=None, in_struct=False, depth=0):
except AttributeError:
ion_type = _ion_type(obj, from_type)
ion_nature = False
if ion_type is None:
raise IonException('Value must have a non-None ion_type: %s, depth: %d, field: %s' % (repr(obj), depth, field))
if not null and ion_type.is_container:
if ion_nature:
event = obj.to_event(IonEventType.CONTAINER_START, field_name=field, in_struct=in_struct, depth=depth)
Expand Down

0 comments on commit f8c61fb

Please sign in to comment.