2014-11-26 10:55:58 -05:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
import json
|
|
|
|
from werkzeug.exceptions import BadRequest
|
|
|
|
|
|
|
|
|
|
|
|
class ResourceNotFoundError(BadRequest):
|
2017-02-23 21:37:43 -05:00
|
|
|
|
2014-11-26 10:55:58 -05:00
|
|
|
def __init__(self, message):
|
|
|
|
super(ResourceNotFoundError, self).__init__()
|
|
|
|
self.description = json.dumps({
|
|
|
|
"message": message,
|
|
|
|
'__type': 'ResourceNotFoundException',
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2015-11-12 10:05:02 +01:00
|
|
|
class ResourceInUseError(BadRequest):
|
2017-02-23 21:37:43 -05:00
|
|
|
|
2015-11-12 10:05:02 +01:00
|
|
|
def __init__(self, message):
|
2018-03-29 18:42:53 -05:00
|
|
|
super(ResourceInUseError, self).__init__()
|
2015-11-12 10:05:02 +01:00
|
|
|
self.description = json.dumps({
|
|
|
|
"message": message,
|
|
|
|
'__type': 'ResourceInUseException',
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2014-11-26 10:55:58 -05:00
|
|
|
class StreamNotFoundError(ResourceNotFoundError):
|
2017-02-23 21:37:43 -05:00
|
|
|
|
2014-11-26 10:55:58 -05:00
|
|
|
def __init__(self, stream_name):
|
|
|
|
super(StreamNotFoundError, self).__init__(
|
2014-11-26 11:13:43 -05:00
|
|
|
'Stream {0} under account 123456789012 not found.'.format(stream_name))
|
2014-11-26 20:49:21 -05:00
|
|
|
|
|
|
|
|
|
|
|
class ShardNotFoundError(ResourceNotFoundError):
|
2017-02-23 21:37:43 -05:00
|
|
|
|
2014-11-26 20:49:21 -05:00
|
|
|
def __init__(self, shard_id):
|
|
|
|
super(ShardNotFoundError, self).__init__(
|
|
|
|
'Shard {0} under account 123456789012 not found.'.format(shard_id))
|
|
|
|
|
|
|
|
|
|
|
|
class InvalidArgumentError(BadRequest):
|
2017-02-23 21:37:43 -05:00
|
|
|
|
2014-11-26 20:49:21 -05:00
|
|
|
def __init__(self, message):
|
|
|
|
super(InvalidArgumentError, self).__init__()
|
|
|
|
self.description = json.dumps({
|
|
|
|
"message": message,
|
|
|
|
'__type': 'InvalidArgumentException',
|
|
|
|
})
|