You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
If I set the mode to
'json'
, and python prints something that isn't JSON, then python-shell's use ofJSON.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 aPythonShell.run()
function in a try catch, using thefunction (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.The text was updated successfully, but these errors were encountered: