Mercurial > p > roundup > code
diff roundup/cgi/exceptions.py @ 5079:65fef7858606
issue2550826 IOError in detector causes apache 'premature end of script headers' error
Capture all exceptions from auditors/reactors and raise a
DetectorError instead. This allows failures like IOErrors from the
detectors (e.g. unable to access files) to be handled. Previously an
IOError just resulted in no output (premature end of headers under
apache). Problem diagnosed and initial patch created by Tom Ekberg
(tekberg).
Patch application/mods and testing by rouilj.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Fri, 10 Jun 2016 23:33:11 -0400 |
| parents | bbab97f8ffb2 |
| children | 32f95ec6bd8e |
line wrap: on
line diff
--- a/roundup/cgi/exceptions.py Fri Jun 10 21:28:40 2016 -0400 +++ b/roundup/cgi/exceptions.py Fri Jun 10 23:33:11 2016 -0400 @@ -18,6 +18,14 @@ class NotModified(HTTPException): pass +class DetectorError(Exception): + """Raised when a detector throws an exception. +Contains details of the exception.""" + def __init__(self, subject, html, txt): + self.subject = subject + self.html = html + self.txt = txt + class FormError(ValueError): """An 'expected' exception occurred during form parsing.
