moto/moto/redshift/exceptions.py

53 lines
1.8 KiB
Python
Raw Normal View History

2014-11-22 19:03:09 +00:00
from __future__ import unicode_literals
import json
from werkzeug.exceptions import BadRequest
class RedshiftClientError(BadRequest):
def __init__(self, code, message):
super(RedshiftClientError, self).__init__()
self.description = json.dumps({
"Error": {
"Code": code,
"Message": message,
'Type': 'Sender',
},
'RequestId': '6876f774-7273-11e4-85dc-39e55ca848d1',
})
class ClusterNotFoundError(RedshiftClientError):
def __init__(self, cluster_identifier):
super(ClusterNotFoundError, self).__init__(
'ClusterNotFound',
"Cluster {0} not found.".format(cluster_identifier))
2014-11-24 02:36:19 +00:00
2014-11-24 03:17:36 +00:00
class ClusterSubnetGroupNotFoundError(RedshiftClientError):
2014-11-24 02:36:19 +00:00
def __init__(self, subnet_identifier):
2014-11-24 03:17:36 +00:00
super(ClusterSubnetGroupNotFoundError, self).__init__(
2014-11-24 02:36:19 +00:00
'ClusterSubnetGroupNotFound',
"Subnet group {0} not found.".format(subnet_identifier))
2014-11-24 03:17:36 +00:00
class ClusterSecurityGroupNotFoundError(RedshiftClientError):
def __init__(self, group_identifier):
super(ClusterSecurityGroupNotFoundError, self).__init__(
'ClusterSecurityGroupNotFound',
"Security group {0} not found.".format(group_identifier))
2014-11-24 04:03:10 +00:00
class ClusterParameterGroupNotFoundError(RedshiftClientError):
def __init__(self, group_identifier):
super(ClusterParameterGroupNotFoundError, self).__init__(
'ClusterParameterGroupNotFound',
"Parameter group {0} not found.".format(group_identifier))
2014-11-24 02:36:19 +00:00
class InvalidSubnetError(RedshiftClientError):
def __init__(self, subnet_identifier):
super(InvalidSubnetError, self).__init__(
'InvalidSubnet',
"Subnet {0} not found.".format(subnet_identifier))