Mercurial > p > roundup > code
annotate roundup/exceptions.py @ 6069:d8d046749b5b
flake8 whitespace fixes; remove unused import backends
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 20 Jan 2020 21:04:17 -0500 |
| parents | 292c9dfd06bd |
| children | c177e7128dc9 |
| rev | line source |
|---|---|
| 4083 | 1 """Exceptions for use across all Roundup components. |
| 2 """ | |
|
2129
3fd672293712
add and use Reject exception [SF#700265]
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
3 |
|
3fd672293712
add and use Reject exception [SF#700265]
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
4 __docformat__ = 'restructuredtext' |
|
3fd672293712
add and use Reject exception [SF#700265]
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
5 |
| 6005 | 6 |
|
5264
32f95ec6bd8e
Python 2 and 3 support. Convert Exception into BaseException in core code.
John Rouillard <rouilj@ieee.org>
parents:
5004
diff
changeset
|
7 class LoginError(BaseException): |
| 4083 | 8 pass |
| 9 | |
| 6005 | 10 |
|
5264
32f95ec6bd8e
Python 2 and 3 support. Convert Exception into BaseException in core code.
John Rouillard <rouilj@ieee.org>
parents:
5004
diff
changeset
|
11 class Unauthorised(BaseException): |
| 4083 | 12 pass |
| 13 | |
| 6005 | 14 |
|
5264
32f95ec6bd8e
Python 2 and 3 support. Convert Exception into BaseException in core code.
John Rouillard <rouilj@ieee.org>
parents:
5004
diff
changeset
|
15 class Reject(BaseException): |
| 4083 | 16 """An auditor may raise this exception when the current create or set |
|
2129
3fd672293712
add and use Reject exception [SF#700265]
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
17 operation should be stopped. |
|
3fd672293712
add and use Reject exception [SF#700265]
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
18 |
|
3fd672293712
add and use Reject exception [SF#700265]
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
19 It is up to the specific interface invoking the create or set to |
|
3fd672293712
add and use Reject exception [SF#700265]
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
20 handle this exception sanely. For example: |
|
3fd672293712
add and use Reject exception [SF#700265]
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
21 |
|
3fd672293712
add and use Reject exception [SF#700265]
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
22 - mailgw will trap and ignore Reject for file attachments and messages |
|
3fd672293712
add and use Reject exception [SF#700265]
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
23 - cgi will trap and present the exception in a nice format |
| 4083 | 24 """ |
|
2129
3fd672293712
add and use Reject exception [SF#700265]
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
25 pass |
|
3fd672293712
add and use Reject exception [SF#700265]
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
26 |
|
5004
494d255043c9
Display errors containing HTML with RejectRaw (issue2550847)
John Kristensen <john@jerrykan.com>
parents:
4083
diff
changeset
|
27 |
|
494d255043c9
Display errors containing HTML with RejectRaw (issue2550847)
John Kristensen <john@jerrykan.com>
parents:
4083
diff
changeset
|
28 class RejectRaw(Reject): |
|
494d255043c9
Display errors containing HTML with RejectRaw (issue2550847)
John Kristensen <john@jerrykan.com>
parents:
4083
diff
changeset
|
29 """ |
|
494d255043c9
Display errors containing HTML with RejectRaw (issue2550847)
John Kristensen <john@jerrykan.com>
parents:
4083
diff
changeset
|
30 Performs the same function as Reject, except HTML in the message is not |
|
494d255043c9
Display errors containing HTML with RejectRaw (issue2550847)
John Kristensen <john@jerrykan.com>
parents:
4083
diff
changeset
|
31 escaped when displayed to the user. |
|
494d255043c9
Display errors containing HTML with RejectRaw (issue2550847)
John Kristensen <john@jerrykan.com>
parents:
4083
diff
changeset
|
32 """ |
|
494d255043c9
Display errors containing HTML with RejectRaw (issue2550847)
John Kristensen <john@jerrykan.com>
parents:
4083
diff
changeset
|
33 pass |
|
494d255043c9
Display errors containing HTML with RejectRaw (issue2550847)
John Kristensen <john@jerrykan.com>
parents:
4083
diff
changeset
|
34 |
|
494d255043c9
Display errors containing HTML with RejectRaw (issue2550847)
John Kristensen <john@jerrykan.com>
parents:
4083
diff
changeset
|
35 |
|
4066
042ace5ddb7c
Move 'UsageError' definition from roundup.admin to roundup.exceptions.
Stefan Seefeld <stefan@seefeld.name>
parents:
2129
diff
changeset
|
36 class UsageError(ValueError): |
|
042ace5ddb7c
Move 'UsageError' definition from roundup.admin to roundup.exceptions.
Stefan Seefeld <stefan@seefeld.name>
parents:
2129
diff
changeset
|
37 pass |
|
042ace5ddb7c
Move 'UsageError' definition from roundup.admin to roundup.exceptions.
Stefan Seefeld <stefan@seefeld.name>
parents:
2129
diff
changeset
|
38 |
|
2129
3fd672293712
add and use Reject exception [SF#700265]
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
39 # vim: set filetype=python ts=4 sw=4 et si |
