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

expose exitCode in awaited result #27

Closed
SuperchupuDev opened this issue Aug 13, 2024 · 3 comments · Fixed by #38
Closed

expose exitCode in awaited result #27

SuperchupuDev opened this issue Aug 13, 2024 · 3 comments · Fixed by #38

Comments

@SuperchupuDev
Copy link

SuperchupuDev commented Aug 13, 2024

useful to have so that users dont need to do await result; result.exitCode

@43081j
Copy link
Member

43081j commented Aug 18, 2024

it probably does make sense to have exit related properties copied onto here

e.g. exitCode, signalCode (when we add it), killed, etc

needs some discussion i think

@VanTanev
Copy link
Contributor

Just fyi, I was confused by this as well, but you basically never need to do await result; result.exitCode - it is going to be zero!

When the subprocess returns non-zero exit code, tinyexec will throw NonZeroExitError. So, you can read a non-zero exitCode only when you wrap the await in try-catch.

@SuperchupuDev
Copy link
Author

SuperchupuDev commented Oct 14, 2024

not if you set throwOnError to false in the options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants