Commit fd8ebe79 authored by Romain Casati's avatar Romain Casati
Browse files

In case of load or hack error (module), the error is displayed and we try to run the code.

parent cabef5a0
......@@ -128,7 +128,15 @@ class InteractiveConsole(_pyodide_console.InteractiveConsole):
result = kernel.format_repr(result)
return result, exec_count
return packages.load_and_hack(pkgs).then(run)
def errorCallback(error, *args):
with self.stdstreams_redirections():
try:
error = error.toString()
except Exception:
pass
print(error, file=sys.stderr, flush=True)
return packages.load_and_hack(pkgs).catch(errorCallback).then(run)
def eval(self, code, stdout_callback, stderr_callback, data=None):
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment