Skip to content

Commit e3529d6

Browse files
committed
Moved debugging exception to .poll()
1 parent c299f9f commit e3529d6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

adafruit_httpserver/server.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@ def serve_forever(self, host: str, port: int = 80) -> None:
151151
except KeyboardInterrupt: # Exit on Ctrl-C e.g. during development
152152
self.stop()
153153
return
154-
except Exception as error: # pylint: disable=broad-except
155-
if self.debug:
156-
_debug_exception_in_handler(error)
157154

158155
def start(self, host: str, port: int = 80) -> None:
159156
"""
@@ -332,6 +329,10 @@ def poll(self):
332329
return
333330
raise
334331

332+
except Exception as error: # pylint: disable=broad-except
333+
if self.debug:
334+
_debug_exception_in_handler(error)
335+
335336
def require_authentication(self, auths: List[Union[Basic, Bearer]]) -> None:
336337
"""
337338
Requires authentication for all routes and files in ``root_path``.

0 commit comments

Comments
 (0)