Skip to content

Silent failure on python exceptions #5

Open
@tessereth

Description

@tessereth

I don't know how much this is to do with your code or Emscripten, but if your python code raises an exception, the do_str promise never resolves. Eg:

import mp_js from 'micropython'

async () => {
  await mp_js.init(64 * 1024)
  const stdout = await mp_js.do_str(`invalid syntax`)
  console.log(stdout) // <-- this never logs and no exception is raised
}();

This makes it very difficult to debug what could be going wrong. It would be great if python exceptions were accessible in some way, even if just logged to console, and the promise rejected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions