Fix error message for missing log stream (#4043)
This commit is contained in:
parent
a230e2a7e3
commit
315c357cd5
@ -333,7 +333,7 @@ class LogGroup(BaseModel):
|
||||
self, log_group_name, log_stream_name, log_events, sequence_token
|
||||
):
|
||||
if log_stream_name not in self.streams:
|
||||
raise ResourceNotFoundException()
|
||||
raise ResourceNotFoundException("The specified log stream does not exist.")
|
||||
stream = self.streams[log_stream_name]
|
||||
return stream.put_log_events(
|
||||
log_group_name, log_stream_name, log_events, sequence_token
|
||||
|
@ -46,12 +46,15 @@ def test_exceptions():
|
||||
logEvents=[{"timestamp": 0, "message": "line"}],
|
||||
)
|
||||
|
||||
with pytest.raises(ClientError):
|
||||
with pytest.raises(ClientError) as ex:
|
||||
conn.put_log_events(
|
||||
logGroupName=log_group_name,
|
||||
logStreamName="invalid-stream",
|
||||
logEvents=[{"timestamp": 0, "message": "line"}],
|
||||
)
|
||||
error = ex.value.response["Error"]
|
||||
error["Code"].should.equal("ResourceNotFoundException")
|
||||
error["Message"].should.equal("The specified log stream does not exist.")
|
||||
|
||||
|
||||
@mock_logs
|
||||
|
Loading…
Reference in New Issue
Block a user