exception must be raise instead returning a response
This commit is contained in:
parent
70171e8ef9
commit
fca96c935d
@ -203,7 +203,7 @@ class KinesisBackend(BaseBackend):
|
|||||||
|
|
||||||
def create_stream(self, stream_name, shard_count, region):
|
def create_stream(self, stream_name, shard_count, region):
|
||||||
if stream_name in self.streams:
|
if stream_name in self.streams:
|
||||||
return ResourceInUseError(stream_name)
|
raise ResourceInUseError(stream_name)
|
||||||
stream = Stream(stream_name, shard_count, region)
|
stream = Stream(stream_name, shard_count, region)
|
||||||
self.streams[stream_name] = stream
|
self.streams[stream_name] = stream
|
||||||
return stream
|
return stream
|
||||||
|
@ -25,9 +25,7 @@ class KinesisResponse(BaseResponse):
|
|||||||
def create_stream(self):
|
def create_stream(self):
|
||||||
stream_name = self.parameters.get('StreamName')
|
stream_name = self.parameters.get('StreamName')
|
||||||
shard_count = self.parameters.get('ShardCount')
|
shard_count = self.parameters.get('ShardCount')
|
||||||
stream = self.kinesis_backend.create_stream(stream_name, shard_count, self.region)
|
self.kinesis_backend.create_stream(stream_name, shard_count, self.region)
|
||||||
if isinstance(stream, BadRequest):
|
|
||||||
return stream.description
|
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def describe_stream(self):
|
def describe_stream(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user