2022-03-07 20:53:45 +00:00
|
|
|
from moto.core.exceptions import JsonRESTError
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DataBrewClientError(JsonRESTError):
|
|
|
|
|
code = 400
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AlreadyExistsException(DataBrewClientError):
|
2022-11-25 14:45:39 -01:00
|
|
|
def __init__(self, typ: str):
|
2022-11-12 21:42:33 -01:00
|
|
|
super().__init__("AlreadyExistsException", f"{typ} already exists.")
|
2022-03-07 20:53:45 +00:00
|
|
|
|
|
|
|
|
|
2022-05-05 21:33:33 +01:00
|
|
|
class ConflictException(DataBrewClientError):
|
|
|
|
|
code = 409
|
|
|
|
|
|
2022-11-25 14:45:39 -01:00
|
|
|
def __init__(self, message: str):
|
|
|
|
|
super().__init__("ConflictException", message)
|
2022-05-05 21:33:33 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class ValidationException(DataBrewClientError):
|
2022-11-25 14:45:39 -01:00
|
|
|
def __init__(self, message: str):
|
|
|
|
|
super().__init__("ValidationException", message)
|
2022-03-07 20:53:45 +00:00
|
|
|
|
|
|
|
|
|
2022-04-07 10:45:17 +01:00
|
|
|
class RulesetAlreadyExistsException(AlreadyExistsException):
|
2022-11-25 14:45:39 -01:00
|
|
|
def __init__(self) -> None:
|
2022-04-07 10:45:17 +01:00
|
|
|
super().__init__("Ruleset")
|
|
|
|
|
|
|
|
|
|
|
2022-03-07 20:53:45 +00:00
|
|
|
class EntityNotFoundException(DataBrewClientError):
|
2022-11-25 14:45:39 -01:00
|
|
|
def __init__(self, msg: str):
|
2022-03-07 20:53:45 +00:00
|
|
|
super().__init__("EntityNotFoundException", msg)
|
|
|
|
|
|
|
|
|
|
|
2022-05-05 21:33:33 +01:00
|
|
|
class ResourceNotFoundException(DataBrewClientError):
|
|
|
|
|
code = 404
|
|
|
|
|
|
2022-11-25 14:45:39 -01:00
|
|
|
def __init__(self, message: str):
|
|
|
|
|
super().__init__("ResourceNotFoundException", message)
|
2022-04-07 10:45:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class RulesetNotFoundException(EntityNotFoundException):
|
2022-11-25 14:45:39 -01:00
|
|
|
def __init__(self, recipe_name: str):
|
2022-11-12 21:42:33 -01:00
|
|
|
super().__init__(f"Ruleset {recipe_name} not found.")
|
2022-05-13 11:48:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class ServiceQuotaExceededException(JsonRESTError):
|
|
|
|
|
code = 402
|
|
|
|
|
|
2022-11-25 14:45:39 -01:00
|
|
|
def __init__(self) -> None:
|
2022-05-13 11:48:04 +01:00
|
|
|
super().__init__(
|
|
|
|
|
"ServiceQuotaExceededException", "A service quota is exceeded."
|
|
|
|
|
)
|