Mercurial > kallithea
annotate rhodecode/lib/exceptions.py @ 2919:29630805893d beta
Implemented proposed changes from pull request #77
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 11 Oct 2012 20:56:01 +0200 |
parents | aa17c7a1b8a5 |
children | 63e58ef80ef1 fa6ba6727475 |
rev | line source |
---|---|
1307 | 1 # -*- coding: utf-8 -*- |
2 """ | |
3 rhodecode.lib.exceptions | |
4 ~~~~~~~~~~~~~~~~~~~~~~~~ | |
5 | |
6 Set of custom exceptions used in RhodeCode | |
7 | |
8 :created_on: Nov 17, 2010 | |
1824
89efedac4e6c
2012 copyrights
Marcin Kuzminski <marcin@python-works.com>
parents:
1532
diff
changeset
|
9 :author: marcink |
89efedac4e6c
2012 copyrights
Marcin Kuzminski <marcin@python-works.com>
parents:
1532
diff
changeset
|
10 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com> |
1532
2afe9320d5e6
updated docstrings
Marcin Kuzminski <marcin@python-works.com>
parents:
1435
diff
changeset
|
11 :license: GPLv3, see COPYING for more details. |
1307 | 12 """ |
1206
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
13 # This program is free software: you can redistribute it and/or modify |
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
14 # it under the terms of the GNU General Public License as published by |
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
15 # the Free Software Foundation, either version 3 of the License, or |
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
16 # (at your option) any later version. |
1203
6832ef664673
source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
17 # |
704
26237de9b613
Added settings model, and Exceptions lib.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
18 # This program is distributed in the hope that it will be useful, |
26237de9b613
Added settings model, and Exceptions lib.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
26237de9b613
Added settings model, and Exceptions lib.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
26237de9b613
Added settings model, and Exceptions lib.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
21 # GNU General Public License for more details. |
1203
6832ef664673
source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
22 # |
704
26237de9b613
Added settings model, and Exceptions lib.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
23 # You should have received a copy of the GNU General Public License |
1206
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
24 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1307 | 25 |
2726
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
26 from webob.exc import HTTPClientError |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
27 |
1307 | 28 |
29 class LdapUsernameError(Exception): | |
30 pass | |
31 | |
32 | |
33 class LdapPasswordError(Exception): | |
34 pass | |
35 | |
704
26237de9b613
Added settings model, and Exceptions lib.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
36 |
1307 | 37 class LdapConnectionError(Exception): |
38 pass | |
39 | |
40 | |
41 class LdapImportError(Exception): | |
42 pass | |
713
1bb0fcdec895
fixed #72 show warning on removal when user still is owner of existing repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
704
diff
changeset
|
43 |
1307 | 44 |
45 class DefaultUserException(Exception): | |
46 pass | |
47 | |
48 | |
49 class UserOwnsReposException(Exception): | |
50 pass | |
1435
a62af7d509ee
fixes #228 - added detection of assigned groups to prevent errors on sqlite
Marcin Kuzminski <marcin@python-works.com>
parents:
1307
diff
changeset
|
51 |
1824
89efedac4e6c
2012 copyrights
Marcin Kuzminski <marcin@python-works.com>
parents:
1532
diff
changeset
|
52 |
1435
a62af7d509ee
fixes #228 - added detection of assigned groups to prevent errors on sqlite
Marcin Kuzminski <marcin@python-works.com>
parents:
1307
diff
changeset
|
53 class UsersGroupsAssignedException(Exception): |
a62af7d509ee
fixes #228 - added detection of assigned groups to prevent errors on sqlite
Marcin Kuzminski <marcin@python-works.com>
parents:
1307
diff
changeset
|
54 pass |
2677
4fbbc65e8cd5
Forbid changing changset status when it is associated with a closed pull request
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
55 |
4fbbc65e8cd5
Forbid changing changset status when it is associated with a closed pull request
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
56 |
4fbbc65e8cd5
Forbid changing changset status when it is associated with a closed pull request
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
57 class StatusChangeOnClosedPullRequestError(Exception): |
2726
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
58 pass |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
59 |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
60 |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
61 class HTTPLockedRC(HTTPClientError): |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
62 """ |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
63 Special Exception For locked Repos in RhodeCode |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
64 """ |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
65 code = 423 |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
66 title = explanation = 'Repository Locked' |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
67 |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
68 def __init__(self, reponame, username, *args, **kwargs): |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
69 self.title = self.explanation = ('Repository `%s` locked by ' |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
70 'user `%s`' % (reponame, username)) |
aa17c7a1b8a5
Implemented basic locking functionality.
Marcin Kuzminski <marcin@python-works.com>
parents:
2677
diff
changeset
|
71 super(HTTPLockedRC, self).__init__(*args, **kwargs) |