Skip to content

Commit

Permalink
style: Fix bare exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
bellisk committed Sep 13, 2023
1 parent be91438 commit e9c2f52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ckanext/dcatapchharvest/dcat_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def uri_to_iri(uri):
try:
iri = iribaker.to_iri(uri)
return iri
except:
raise ValueError("Provided URI can't be converted to IRI")
except Exception as e:
raise ValueError("Provided URI can't be converted to IRI: %s" % e)


def get_langs():
Expand Down
4 changes: 2 additions & 2 deletions ckanext/dcatapchharvest/harvesters.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def _get_guid(self, dataset_dict, source_url=None): # noqa
log.error(error_msg)
self._save_gather_error(error_msg, self.harvest_job)
return None
except:
log.exception("An error occured")
except Exception as e:
log.exception("Error when getting identifier: %s" % e)
return None
return dataset_dict['identifier']

Expand Down

0 comments on commit e9c2f52

Please sign in to comment.