diff --git a/rhodecode/lib/exceptions.py b/rhodecode/lib/exceptions.py --- a/rhodecode/lib/exceptions.py +++ b/rhodecode/lib/exceptions.py @@ -23,6 +23,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +from webob.exc import HTTPClientError + class LdapUsernameError(Exception): pass @@ -53,4 +55,17 @@ class UsersGroupsAssignedException(Excep class StatusChangeOnClosedPullRequestError(Exception): - pass \ No newline at end of file + pass + + +class HTTPLockedRC(HTTPClientError): + """ + Special Exception For locked Repos in RhodeCode + """ + code = 423 + title = explanation = 'Repository Locked' + + def __init__(self, reponame, username, *args, **kwargs): + self.title = self.explanation = ('Repository `%s` locked by ' + 'user `%s`' % (reponame, username)) + super(HTTPLockedRC, self).__init__(*args, **kwargs)