1import json 2 3from moto.core.exceptions import AWSError 4 5 6class EKSError(AWSError): 7 def __init__(self, *args, **kwargs): 8 super(AWSError, self).__init__() 9 self.description = json.dumps(kwargs) 10 self.headers = {"status": self.STATUS, "x-amzn-ErrorType": self.TYPE} 11 12 def response(self): 13 return self.STATUS, self.headers, self.description 14 15 16class ResourceInUseException(EKSError): 17 TYPE = "ResourceInUseException" 18 STATUS = 409 19 20 21class ResourceNotFoundException(EKSError): 22 TYPE = "ResourceNotFoundException" 23 STATUS = 404 24 25 26class InvalidParameterException(EKSError): 27 TYPE = "InvalidParameterException" 28 STATUS = 400 29 30 31class InvalidRequestException(EKSError): 32 TYPE = "InvalidRequestException" 33 STATUS = 400 34