diff --git a/uvicorn/protocols/http/httptools_impl.py b/uvicorn/protocols/http/httptools_impl.py index e60277422..7be086562 100644 --- a/uvicorn/protocols/http/httptools_impl.py +++ b/uvicorn/protocols/http/httptools_impl.py @@ -163,9 +163,9 @@ def data_received(self, data): try: self.parser.feed_data(data) - except httptools.HttpParserError: + except httptools.HttpParserError as exc: msg = "Invalid HTTP request received." - self.logger.warning(msg) + self.logger.warning(msg, exc_info=exc) self.transport.close() except httptools.HttpParserUpgrade: self.handle_upgrade()