FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Can't catch JSON.parse() error? · Issue #253 · extrabacon/python-shell · GitHub

Repository navigation

Can't catch JSON.parse() error? #253

Description

If I set the mode to 'json', and python prints something that isn't JSON, then python-shell's use of JSON.parse() causes an error as one would expect. However, I can't seem to catch the error and it's just crashing my program.

I've tried wrapping either a PythonShell() object or a PythonShell.run() function in a try catch, using the function (err) callback, listing to an 'error' emit, but nothing can seem to catch this error.

For now I can set it to text mode and manually call JSON.parse() but this seems an unsatisfying solution.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL