diff --git a/ckanext/datajson/datajson.py b/ckanext/datajson/datajson.py index 26c0dcad..b37b3d1b 100644 --- a/ckanext/datajson/datajson.py +++ b/ckanext/datajson/datajson.py @@ -814,6 +814,10 @@ def import_stage(self, harvest_object): pkg['name'] = self.make_package_name(dataset_processed["title"], harvest_object.guid) pkg = get_action('package_create')(self.context(), pkg) log.warn('created package %s (%s) from %s' % (pkg["name"], pkg["id"], harvest_object.source.url)) + except ValidationError as e: + log.error('Failed to create package %s: %s' % (pkg["name"], str(e))) + self._save_object_error('Error creating package: %s' % (e), harvest_object, 'Import') + return None except Exception as e: log.error('Failed to create package %s from %s\n\t%s\n\t%s' % (pkg["name"], harvest_object.source.url,