Skip to content

Commit

Permalink
handle GeoJSON error instead of crashing fetch consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
FuhuXia committed Nov 15, 2023
1 parent 154ff0f commit 362868d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ckanext/datajson/datajson.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 362868d

Please sign in to comment.