moto/moto/appsync/exceptions.py
2023-11-30 14:55:51 -01:00

29 lines
731 B
Python

import json
from moto.core.exceptions import JsonRESTError
class AppSyncExceptions(JsonRESTError):
pass
class GraphqlAPINotFound(AppSyncExceptions):
code = 404
def __init__(self, api_id: str):
super().__init__("NotFoundException", f"GraphQL API {api_id} not found.")
self.description = json.dumps({"message": self.message})
class GraphQLSchemaException(AppSyncExceptions):
code = 400
def __init__(self, message: str):
super().__init__("GraphQLSchemaException", message)
self.description = json.dumps({"message": self.message})
class BadRequestException(AppSyncExceptions):
def __init__(self, message: str):
super().__init__("BadRequestException", message)