Mercurial > p > roundup > code
comparison roundup/cgi/exceptions.py @ 6123:c177e7128dc9
issue2551083 Replace BaseException and Exception with RoundupException
issue2551083 - Replace BaseException and Exception as base classes
with new RoundupException (inheriting from Exception) for most roundup
exceptions.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Fri, 03 Apr 2020 16:18:59 -0400 |
| parents | 0dc1e0222353 |
| children | 91ab3e0ffcd0 |
comparison
equal
deleted
inserted
replaced
| 6120:370cc9052239 | 6123:c177e7128dc9 |
|---|---|
| 5 | 5 |
| 6 from roundup.exceptions import LoginError, Unauthorised # noqa: F401 | 6 from roundup.exceptions import LoginError, Unauthorised # noqa: F401 |
| 7 | 7 |
| 8 from roundup.anypy.html import html_escape | 8 from roundup.anypy.html import html_escape |
| 9 | 9 |
| 10 from roundup.exceptions import RoundupException | |
| 10 | 11 |
| 11 class HTTPException(BaseException): | 12 class RoundupCGIException(RoundupException): |
| 13 pass | |
| 14 | |
| 15 class HTTPException(RoundupCGIException): | |
| 12 pass | 16 pass |
| 13 | 17 |
| 14 | 18 |
| 15 class Redirect(HTTPException): | 19 class Redirect(HTTPException): |
| 16 pass | 20 pass |
| 26 | 30 |
| 27 class PreconditionFailed(HTTPException): | 31 class PreconditionFailed(HTTPException): |
| 28 pass | 32 pass |
| 29 | 33 |
| 30 | 34 |
| 31 class DetectorError(BaseException): | 35 class DetectorError(RoundupException): |
| 32 """Raised when a detector throws an exception. | 36 """Raised when a detector throws an exception. |
| 33 Contains details of the exception.""" | 37 Contains details of the exception.""" |
| 34 def __init__(self, subject, html, txt): | 38 def __init__(self, subject, html, txt): |
| 35 self.subject = subject | 39 self.subject = subject |
| 36 self.html = html | 40 self.html = html |
| 49 | 53 |
| 50 """ | 54 """ |
| 51 pass | 55 pass |
| 52 | 56 |
| 53 | 57 |
| 54 class SendFile(BaseException): | 58 class SendFile(RoundupException): |
| 55 """Send a file from the database.""" | 59 """Send a file from the database.""" |
| 56 | 60 |
| 57 | 61 |
| 58 class SendStaticFile(BaseException): | 62 class SendStaticFile(RoundupException): |
| 59 """Send a static file from the instance html directory.""" | 63 """Send a static file from the instance html directory.""" |
| 60 | 64 |
| 61 | 65 |
| 62 class SeriousError(BaseException): | 66 class SeriousError(RoundupException): |
| 63 """Raised when we can't reasonably display an error message on a | 67 """Raised when we can't reasonably display an error message on a |
| 64 templated page. | 68 templated page. |
| 65 | 69 |
| 66 The exception value will be displayed in the error page, HTML | 70 The exception value will be displayed in the error page, HTML |
| 67 escaped. | 71 escaped. |
