Skip to content

Commit 81e8c57

Browse files
committed
Add logging for failed http requests
1 parent 46a2651 commit 81e8c57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/reactpy/testing/display.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ async def configure_page(self) -> None:
7575
self.page = await self.exit_stack.enter_async_context(self.page)
7676
self.page.set_default_navigation_timeout(self.timeout * 1000)
7777
self.page.set_default_timeout(self.timeout * 1000)
78+
self.page.on(
79+
"requestfailed",
80+
lambda x: print(f"BROWSER LOAD ERROR: {x.url}\n{x.failure}"), # noqa: T201
81+
)
7882
self.page.on("console", lambda x: print(f"BROWSER CONSOLE: {x.text}")) # noqa: T201
7983
self.page.on(
8084
"pageerror",

0 commit comments

Comments
 (0)