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
We get a childP.on is not a function error in our logs occasionally with code like this:
letchildP=execa(...);childP.on('message', ...);
After checking execa's code, I quickly found this, which changes any synchronously thrown errors to promise rejections.
I guess this was done to make it easier to catch all errors via .catch() but it makes it impossible to rely on the returned value and it isn't documented. It's ok if execa extends the error with other properties, but it should be thrown synchronously in this case.
The text was updated successfully, but these errors were encountered:
We get a
childP.on is not a function
error in our logs occasionally with code like this:After checking execa's code, I quickly found this, which changes any synchronously thrown errors to promise rejections.
I guess this was done to make it easier to catch all errors via
.catch()
but it makes it impossible to rely on the returned value and it isn't documented. It's ok if execa extends the error with other properties, but it should be thrown synchronously in this case.The text was updated successfully, but these errors were encountered: