Add a better error message for no-more-responses

This commit is contained in:
Pradyun Gedam 2020-10-30 18:00:13 +05:30
parent 53db14b188
commit 16c3205184
No known key found for this signature in database
GPG Key ID: FF99710C4332258E
1 changed files with 4 additions and 1 deletions

View File

@ -97,7 +97,10 @@ def _mock_wsgi_adapter(mock):
"""
def adapter(environ, start_response):
# type: (Environ, StartResponse) -> Body
responder = mock(environ, start_response)
try:
responder = mock(environ, start_response)
except StopIteration:
raise RuntimeError('Ran out of mocked responses.')
return responder(environ, start_response)
return adapter