2023-03-05 09:27:17 -01:00
|
|
|
from typing import Optional
|
2023-11-30 07:55:51 -08:00
|
|
|
|
2021-01-11 10:41:31 +01:00
|
|
|
from moto.core.exceptions import JsonRESTError
|
|
|
|
|
|
|
|
|
2021-03-01 14:20:36 +01:00
|
|
|
class IllegalStatusException(JsonRESTError):
|
|
|
|
code = 400
|
|
|
|
|
2023-03-05 09:27:17 -01:00
|
|
|
def __init__(self, message: str):
|
2021-12-28 21:26:56 -01:00
|
|
|
super().__init__("IllegalStatusException", message)
|
2021-03-01 14:20:36 +01:00
|
|
|
|
|
|
|
|
2021-01-28 11:47:53 +01:00
|
|
|
class InvalidEventPatternException(JsonRESTError):
|
|
|
|
code = 400
|
|
|
|
|
2023-03-05 09:27:17 -01:00
|
|
|
def __init__(self, reason: Optional[str] = None):
|
2021-08-13 02:01:44 -03:00
|
|
|
msg = "Event pattern is not valid. "
|
|
|
|
if reason:
|
|
|
|
msg += f"Reason: {reason}"
|
|
|
|
|
2021-12-28 21:26:56 -01:00
|
|
|
super().__init__("InvalidEventPatternException", msg)
|
2021-01-28 11:47:53 +01:00
|
|
|
|
|
|
|
|
2021-01-11 10:41:31 +01:00
|
|
|
class ResourceNotFoundException(JsonRESTError):
|
|
|
|
code = 400
|
|
|
|
|
2023-03-05 09:27:17 -01:00
|
|
|
def __init__(self, message: str):
|
2021-12-28 21:26:56 -01:00
|
|
|
super().__init__("ResourceNotFoundException", message)
|
2021-01-11 10:41:31 +01:00
|
|
|
|
|
|
|
|
2021-01-28 11:47:53 +01:00
|
|
|
class ResourceAlreadyExistsException(JsonRESTError):
|
|
|
|
code = 400
|
|
|
|
|
2023-03-05 09:27:17 -01:00
|
|
|
def __init__(self, message: str):
|
2021-12-28 21:26:56 -01:00
|
|
|
super().__init__("ResourceAlreadyExistsException", message)
|
2021-01-28 11:47:53 +01:00
|
|
|
|
|
|
|
|
2021-01-11 10:41:31 +01:00
|
|
|
class ValidationException(JsonRESTError):
|
|
|
|
code = 400
|
|
|
|
|
2023-03-05 09:27:17 -01:00
|
|
|
def __init__(self, message: str):
|
2021-12-28 21:26:56 -01:00
|
|
|
super().__init__("ValidationException", message)
|