Skip to content

Commit

Permalink
BF: general Exception catch was excessive. Only IOError and OSError a…
Browse files Browse the repository at this point in the history
…re possible and has different meanings
  • Loading branch information
grooverdan committed Mar 10, 2013
1 parent 6e77427 commit c8c7b0b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,15 @@ def getFailures(self, filename):
# Try to open log file.
try:
container.open()
except Exception, e:
# see http://python.org/dev/peps/pep-3151/
except IOError, e:
logSys.error("Unable to open %s" % filename)
logSys.exception(e)
return False
except OSError, e: # pragma: no cover - requires race condition to tigger this
logSys.error("Error opening %s" % filename)
logSys.exception(e)
return False

while True:
line = container.readline()
Expand Down

0 comments on commit c8c7b0b

Please sign in to comment.