Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The error object doesn't have Error & traceback properties. #309

Open
varun-liftoff opened this issue Aug 22, 2024 · 0 comments
Open

The error object doesn't have Error & traceback properties. #309

varun-liftoff opened this issue Aug 22, 2024 · 0 comments
Labels

Comments

@varun-liftoff
Copy link

varun-liftoff commented Aug 22, 2024

Bug
I am trying to display a proper error message but the whole traceback is being printed

Python code
raise Exception("Error sample")

Javascript code

const messages = await PythonShell.run("script.py", options);
console.log("File Validated Successfully");
console.log(`Results - ${messages}`);

Expected behavior
Exception: Error Sample

Actual behavior
Whole traceback is printed. When I checked the error object in Javascript, it looks like this -

{
  executable: 'python3',
  options: [ '-u' ],
  script: 'script.py',
  args: [],
  exitCode: 1,
  logs: []
}

Other Information

  • OS: [Sonoma 14.6.1]
  • Python Version [3.9.8]
  • Node Version [22.4.1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant