On rare occasions, a Javascript object that isn't an error gets thrown.
This PR ensures that we are handling this situation without anything going
too far astray.

This is a followup to #2236.
Add handling and tests for weird Javascript errors. On rare occasions, a Javascript object that isn't an error gets thrown.
This PR ensures that we are handling this situation without anything going
too far astray.

This is a followup to #2236.
from pyodide_build.testing import run_in_pyodide


@run_in_pyodide(packages=["Jinja2"])
def test_jinja2():
    import jinja2

    template = jinja2.Template("Hello {{ name }}!")
    content = template.render(name="Zach")
    assert content == "Hello Zach!"

from pyodide_build.testing import run_in_pyodide


@run_in_pyodide(packages=["Jinja2"])
def test_jinja2():
    import jinja2

    template = jinja2.Template("Hello {{ name }}!")
    content = template.render(name="Zach")
    assert content == "Hello Zach!"
