1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
import json
from typing import Optional
from moto.core.exceptions import JsonRESTError
class AthenaClientError(JsonRESTError):
def __init__(self, code: str, message: str):
super().__init__(error_type="InvalidRequestException", message=message)
self.description = json.dumps(
{
"Error": {
"Code": code,
"Message": message,
"Type": "InvalidRequestException",
},
"RequestId": "6876f774-7273-11e4-85dc-39e55ca848d1",
}
)
class InvalidArgumentException(JsonRESTError):
"""The specified input parameter has a value that is not valid."""
code = 400
def __init__(self, message: str):
super().__init__("InvalidArgumentException", message)
class QueryStillRunning(JsonRESTError):
def __init__(self, current_status: Optional[str]):
msg = f"Query has not yet finished. Current state: {current_status}"
super().__init__("InvalidRequestException", msg)
|