obaydmerz / powerjs

Do the powershell magic... right from your script!
MIT License
8 stars 3 forks source link

Promises should reject rather than throw errors #3

Closed rsmarples closed 10 months ago

rsmarples commented 10 months ago

Then in the caller we can try ... catch the error and handle it gracefully.

obaydmerz commented 10 months ago

this is a good suggestion, thank you @rsmarples, i will merge it, but i want to know what's the difference.

rsmarples commented 10 months ago

but i want to know what's the difference.

https://catchjs.com/Docs/AsyncAwait

Basically it's an async issue.

To be clear I have a few levels of async promises on top of the PowerJS.exec() and this is inside an Electron IPC call which I need to bubble back to the IPC renderer process. Which it now does with this change.