1from moto.core.exceptions import JsonRESTError
2
3
4class IllegalStatusException(JsonRESTError):
5    code = 400
6
7    def __init__(self, message):
8        super(IllegalStatusException, self).__init__("IllegalStatusException", message)
9
10
11class InvalidEventPatternException(JsonRESTError):
12    code = 400
13
14    def __init__(self, reason=None):
15        msg = "Event pattern is not valid. "
16        if reason:
17            msg += f"Reason: {reason}"
18
19        super(InvalidEventPatternException, self).__init__(
20            "InvalidEventPatternException", msg
21        )
22
23
24class ResourceNotFoundException(JsonRESTError):
25    code = 400
26
27    def __init__(self, message):
28        super(ResourceNotFoundException, self).__init__(
29            "ResourceNotFoundException", message
30        )
31
32
33class ResourceAlreadyExistsException(JsonRESTError):
34    code = 400
35
36    def __init__(self, message):
37        super(ResourceAlreadyExistsException, self).__init__(
38            "ResourceAlreadyExistsException", message
39        )
40
41
42class ValidationException(JsonRESTError):
43    code = 400
44
45    def __init__(self, message):
46        super(ValidationException, self).__init__("ValidationException", message)
47