moto/moto/comprehend/exceptions.py

31 lines
1.1 KiB
Python

"""Exceptions raised by the comprehend service."""
from moto.core.exceptions import JsonRESTError
from typing import List
class ResourceNotFound(JsonRESTError):
def __init__(self) -> None:
super().__init__(
"ResourceNotFoundException",
"RESOURCE_NOT_FOUND: Could not find specified resource.",
)
class DetectPIIValidationException(JsonRESTError):
def __init__(self, language: str, all_languages: List[str]) -> None:
all_languages_str = str(all_languages).replace("'", "")
super().__init__(
"ValidationException",
f"Value '{language}' at 'languageCode'failed to satisfy constraint: "
f"Member must satisfy enum value set: {all_languages_str}",
)
class TextSizeLimitExceededException(JsonRESTError):
def __init__(self, size: int) -> None:
super().__init__(
"TextSizeLimitExceededException",
"Input text size exceeds limit. Max length of request text allowed is 100000 bytes while in "
f"this request the text size is {size} bytes",
)