1 class AurwebException(Exception):
5 class MaintenanceException(AurwebException
):
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
)