diff --git a/segment_source_resource/sync.py b/segment_source_resource/sync.py index 3b0de72..cb0d4de 100644 --- a/segment_source_resource/sync.py +++ b/segment_source_resource/sync.py @@ -1,4 +1,5 @@ import typing +import json from gevent.pool import Pool from gevent.thread import Greenlet @@ -42,9 +43,15 @@ def _process_resource(resources: typing.List[Resource], seed: typing.Any, resour else: obj = resource.transform(raw_obj, seed) - source.set(obj.collection, obj.id, obj.properties) - thread = threads.spawn(_enqueue_children, resources, raw_obj, resource) - thread.link_exception(_create_error_handler(resource.collection)) + try: + source.set(obj.collection, obj.id, obj.properties) + thread = threads.spawn(_enqueue_children, resources, raw_obj, resource) + thread.link_exception(_create_error_handler(resource.collection)) + except: + # if there's an object being set that the server rejects, this log point + # will print it out so we can address it in the logs + print('source.set({}, {}, {})'.format(obj.collection, obj.id, json.dumps(obj.properties))) + raise threads.join() diff --git a/setup.py b/setup.py index af3f1a8..d4676ca 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name='segment_source_resource', packages=['segment_source_resource'], - version='0.9.10', + version='0.9.11', description='Abstraction to make sources easier to write', author='Segment', author_email='friends@segment.com',