exception must be raise instead returning a response

This commit is contained in:
root 2015-12-04 08:56:49 +00:00
parent 70171e8ef9
commit fca96c935d
2 changed files with 2 additions and 4 deletions

View File

@ -203,7 +203,7 @@ class KinesisBackend(BaseBackend):
def create_stream(self, stream_name, shard_count, region):
if stream_name in self.streams:
return ResourceInUseError(stream_name)
raise ResourceInUseError(stream_name)
stream = Stream(stream_name, shard_count, region)
self.streams[stream_name] = stream
return stream

View File

@ -25,9 +25,7 @@ class KinesisResponse(BaseResponse):
def create_stream(self):
stream_name = self.parameters.get('StreamName')
shard_count = self.parameters.get('ShardCount')
stream = self.kinesis_backend.create_stream(stream_name, shard_count, self.region)
if isinstance(stream, BadRequest):
return stream.description
self.kinesis_backend.create_stream(stream_name, shard_count, self.region)
return ""
def describe_stream(self):