git-serve: Add support for (un-)voting
[aur.git] / aurweb / exceptions.py
blob639f9e09d77a4d95e98cb84801112c2e1994334c
1 class AurwebException(Exception):
2 pass
5 class MaintenanceException(AurwebException):
6 pass
9 class PermissionDeniedException(AurwebException):
10 def __init__(self, user):
11 msg = 'permission denied: {:s}'.format(user)
12 super(PermissionDeniedException, self).__init__(msg)
15 class InvalidUserException(AurwebException):
16 def __init__(self, user):
17 msg = 'unknown user: {:s}'.format(user)
18 super(InvalidUserException, self).__init__(msg)
21 class InvalidPackageBaseException(AurwebException):
22 def __init__(self, pkgbase):
23 msg = 'package base not found: {:s}'.format(pkgbase)
24 super(InvalidPackageBaseException, self).__init__(msg)
27 class InvalidRepositoryNameException(AurwebException):
28 def __init__(self, pkgbase):
29 msg = 'invalid repository name: {:s}'.format(pkgbase)
30 super(InvalidRepositoryNameException, self).__init__(msg)
33 class PackageBaseExistsException(AurwebException):
34 def __init__(self, pkgbase):
35 msg = 'package base already exists: {:s}'.format(pkgbase)
36 super(PackageBaseExistsException, self).__init__(msg)
39 class InvalidReasonException(AurwebException):
40 def __init__(self, reason):
41 msg = 'invalid reason: {:s}'.format(reason)
42 super(InvalidReasonException, self).__init__(msg)
45 class InvalidCommentException(AurwebException):
46 def __init__(self, comment):
47 msg = 'comment is too short: {:s}'.format(comment)
48 super(InvalidCommentException, self).__init__(msg)
51 class AlreadyVotedException(AurwebException):
52 def __init__(self, comment):
53 msg = 'already voted for package base: {:s}'.format(comment)
54 super(AlreadyVotedException, self).__init__(msg)
57 class NotVotedException(AurwebException):
58 def __init__(self, comment):
59 msg = 'missing vote for package base: {:s}'.format(comment)
60 super(NotVotedException, self).__init__(msg)
63 class InvalidArgumentsException(AurwebException):
64 def __init__(self, msg):
65 super(InvalidArgumentsException, self).__init__(msg)