Skip to content

Commit

Permalink
Merge pull request #90 from GSA/improve_log_error
Browse files Browse the repository at this point in the history
Show full packge_create error
  • Loading branch information
thejuliekramer authored Dec 1, 2020
2 parents a99b5ab + c66bf8c commit e93b412
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ckanext/datajson/datajson_ckan_28.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def load_config(self, harvest_source):
if harvest_source.config is None or harvest_source.config == '':
harvest_source.config = '{}'
source_config = json.loads(harvest_source.config)
log.debug('SOURCE CONFIG {}'.format(source_config))
log.debug('SOURCE CONFIG from DB {}'.format(source_config))
ret.update(source_config)

return ret
Expand Down Expand Up @@ -732,8 +732,8 @@ 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:
log.error('failed to create package %s from %s' % (pkg["name"], harvest_object.source.url))
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, unicode(pkg), unicode(e)))
raise

# Flag the other HarvestObjects linking to this package as not current anymore
Expand Down

0 comments on commit e93b412

Please sign in to comment.