Skip to content

Commit 28eafd0

Browse files
FlorianLudwigcsernazs
authored andcommitted
improve error message on missing response
1 parent 4d1f699 commit 28eafd0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎pytest_httpserver/httpserver.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,15 +442,15 @@ def respond(self, request: Request) -> Response:
442442
"""
443443
Calls the request handler registered for this object.
444444
445-
If no request handler was specified previously, it raises
445+
If no response was specified previously, it raises
446446
:py:class:`NoHandlerError` exception.
447447
448448
:param request: the incoming request object
449449
:return: the response object
450450
"""
451451

452452
if self.request_handler is None:
453-
raise NoHandlerError("No handler found for request: {} {}".format(request.method, request.path))
453+
raise NoHandlerError("Matching request handler found but no response defined: {} {}".format(request.method, request.path))
454454
else:
455455
return self.request_handler(request)
456456

0 commit comments

Comments
 (0)