MCPcopy Create free account
hub / github.com/cztomczak/cefpython / OnLoadError

Method OnLoadError

examples/screenshot.py:198–210  ·  view source on GitHub ↗

Called when the resource load for a navigation fails or is canceled.

(self, browser, frame, error_code, failed_url, **_)

Source from the content-addressed store, hash-verified

196 cef.PostDelayedTask(cef.TID_UI, 2000, save_screenshot, browser)
197
198 def OnLoadError(self, browser, frame, error_code, failed_url, **_):
199 """Called when the resource load for a navigation fails
200 or is canceled."""
201 if not frame.IsMain():
202 # We are interested only in loading main url.
203 # Ignore any errors during loading of other frames.
204 return
205 print("[screenshot.py] ERROR: Failed to load url: {url}"
206 .format(url=failed_url))
207 print("[screenshot.py] Error code: {code}"
208 .format(code=error_code))
209 # See comments in exit_app() why PostTask must be used
210 cef.PostTask(cef.TID_UI, exit_app, browser)
211
212
213class RenderHandler(object):

Callers

nothing calls this directly

Calls 1

PostTaskMethod · 0.80

Tested by

no test coverage detected