Permalink
Browse files

don't hide traceback when excepting

  • Loading branch information...
1 parent a329793 commit 11f912a9992fb0c0d42bb2ba30b91ac51c2b869e @posativ committed Mar 23, 2013
@@ -102,8 +102,8 @@ def repl(match):
try:
return ''.join(Acrynomify(text, abbr, repl).result)
- except HTMLParseError as e:
- log.warn('%s: %s in %s' % (e.__class__.__name__, e.msg, entry.filename))
+ except HTMLParseError:
+ log.exception('could not acronymize ' + entry.filename)
return text
@@ -192,5 +192,5 @@ def transform(self, content, entry, *args):
try:
return ''.join(Separator(content, hyphenate_word, length=length).result)
except HTMLParseError as e:
- log.warn('%s: %s in %s' % (e.__class__.__name__, e.msg, entry.filename))
+ log.exception('could not hyphenate ' + entry.filename)
return content
@@ -96,7 +96,6 @@ def transform(self, content, entry, *args):
return ''.join(Introducer(
content, maxparagraphs, self.env.path+entry.permalink, options).result)
except HTMLParseError as e:
- log.warn('%s: %s in %s' % (e.__class__.__name__, e.msg,
- entry.filename))
+ log.exception('could not extract intro from ' + entry.filename)
return content
return content
@@ -55,6 +55,6 @@ def transform(self, content, entry, *args):
try:
return ''.join(Text(content, args).result)
- except HTMLParseError as e:
- log.warn('%s: %s in %s' % (e.__class__.__name__, e.msg, entry.filename))
+ except HTMLParseError:
+ log.exception('could not strip ' + entry.filename)
return content
@@ -124,6 +124,6 @@ def transform(self, content, entry, *args):
try:
return ''.join(Summarizer(
content, maxwords, self.env.path+entry.permalink, options).result)
- except HTMLParseError as e:
- log.warn('%s: %s in %s' % (e.__class__.__name__, e.msg, entry.filename))
+ except HTMLParseError:
+ log.exception('could not summarize ' + entry.filename)
return content
View
@@ -61,7 +61,7 @@ def load(conf):
try:
entry = Entry(path, conf)
if entry in seen:
- raise AcrylamidException(
+ raise RuntimeError(
"REPORT THIS IMMEDIATELY: python's hash function is not safe!")
seen.add(entry)
@@ -71,8 +71,9 @@ def load(conf):
entries.append(entry)
else:
pages.append(entry)
- except (ValueError, AcrylamidException) as e:
- raise AcrylamidException('%s: %s' % (path, e.args[0]))
+ except:
+ log.fatal('uncaught exception for ' + path)
+ raise
# sort by date, reverse
return sorted(entries, key=lambda k: k.date, reverse=True), pages, trans, drafts

0 comments on commit 11f912a

Please sign in to comment.