diff --git a/wasm/demo/src/index.js b/wasm/demo/src/index.js index db3554c48..1af847d59 100644 --- a/wasm/demo/src/index.js +++ b/wasm/demo/src/index.js @@ -21,7 +21,14 @@ import('rustpython') }) .catch((e) => { console.error('Error importing `rustpython`:', e); - document.getElementById('error').textContent = e; + let errorDetails = e.toString(); + if (window.__RUSTPYTHON_ERROR) { + errorDetails += '\nRustPython Error: ' + window.__RUSTPYTHON_ERROR; + } + if (window.__RUSTPYTHON_ERROR_STACK) { + errorDetails += '\nStack: ' + window.__RUSTPYTHON_ERROR_STACK; + } + document.getElementById('error').textContent = errorDetails; }); const fixedHeightEditor = EditorView.theme({ diff --git a/wasm/tests/conftest.py b/wasm/tests/conftest.py index ecb5b0007..84a253057 100644 --- a/wasm/tests/conftest.py +++ b/wasm/tests/conftest.py @@ -102,6 +102,12 @@ def wdriver(request): driver._print_panic() driver.quit() raise + except Exception as e: + print(f"Error waiting for page to load: {e}") + # Check the page source to see what's loaded + print("Page source:", driver.page_source[:500]) + driver.quit() + raise yield driver