Skip to content

Commit

Permalink
Modify raise in extract (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kebniss authored and lopuhin committed Mar 29, 2018
1 parent 9e86435 commit 0c4d6dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extruct/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def extract(htmlstring, url='http://www.example.com/', encoding="UTF-8",
output[label] = [obj for obj in extract(document=tree,
url=url,
html=htmlstring)]
except Exception as e:
except Exception:
if errors == 'log':
logger.exception("Failed to parse %s", url)
logger.exception("Failed to extract {} from {}".format(label, url))
if errors == 'ignore':
pass
if errors == 'strict':
raise e
raise
return output

0 comments on commit 0c4d6dd

Please sign in to comment.