Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

vad: that's fine, but please call it ReadabilityError at least :)

  • Loading branch information...
commit e5df5ef99ebc8efb5f2869f887691fe5a7e9841f 1 parent 49520cd
@srid authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 readability.py
View
6 readability.py
@@ -19,7 +19,7 @@
# TODO: have sub-classes for specific exceptions
-class Error(Exception):
+class ReadabilityError(Exception):
"""Base class for all readability related exceptions"""
@@ -38,7 +38,7 @@ def grabContent(link, html, encoding=DEFAULT_ENCODING):
try:
soup = BeautifulSoup(html)
except HTMLParser.HTMLParseError as e:
- raise Error('BeautifulSoup parse error: %s' % e)
+ raise ReadabilityError('BeautifulSoup parse error: %s' % e)
# REMOVE SCRIPTS
for s in soup.findAll("script"):
@@ -90,7 +90,7 @@ def grabContent(link, html, encoding=DEFAULT_ENCODING):
topParent = parent
if not topParent:
- raise Error("no topParent")
+ raise ReadabilityError("no topParent")
# REMOVES ALL STYLESHEETS ...
styleLinks = soup.findAll("link", attrs={"type": "text/css"})
Please sign in to comment.
Something went wrong with that request. Please try again.