Skip to content

Commit 2d4eec8

Browse files
committed
better webdriver error printing
1 parent 7f94c10 commit 2d4eec8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

wasm/demo/src/index.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ import('rustpython')
2121
})
2222
.catch((e) => {
2323
console.error('Error importing `rustpython`:', e);
24-
document.getElementById('error').textContent = e;
24+
let errorDetails = e.toString();
25+
if (window.__RUSTPYTHON_ERROR) {
26+
errorDetails += '\nRustPython Error: ' + window.__RUSTPYTHON_ERROR;
27+
}
28+
if (window.__RUSTPYTHON_ERROR_STACK) {
29+
errorDetails += '\nStack: ' + window.__RUSTPYTHON_ERROR_STACK;
30+
}
31+
document.getElementById('error').textContent = errorDetails;
2532
});
2633

2734
const fixedHeightEditor = EditorView.theme({

wasm/tests/conftest.py

+6
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ def wdriver(request):
102102
driver._print_panic()
103103
driver.quit()
104104
raise
105+
except Exception as e:
106+
print(f"Error waiting for page to load: {e}")
107+
# Check the page source to see what's loaded
108+
print("Page source:", driver.page_source[:500])
109+
driver.quit()
110+
raise
105111

106112
yield driver
107113

0 commit comments

Comments
 (0)