Permalink
Browse files

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

  • Loading branch information...
1 parent 49520cd commit e5df5ef99ebc8efb5f2869f887691fe5a7e9841f Sridhar Ratnakumar committed Jan 4, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 readability.py
View
@@ -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"})

0 comments on commit e5df5ef

Please sign in to comment.