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
I spend some time writing and debugging a little script. I found that an import of @salesforce/core registers a handler to ‘uncaughtException’. This pollutes global scope and prevents showing uncaught exceptions and returning non zero exit code.
Sample code:
import{Org}from'@salesforce/core'thrownewError('this should be printed to stderr and returned non zero exit code')
The above script should print an error and return 1. But it does nothing and returns 0.
It is the first import handling ‘uncaughtException’. Comment first line to get proper behaviour.
Another side effect is swallowing errors like this:
I spend some time writing and debugging a little script. I found that an import of @salesforce/core registers a handler to ‘uncaughtException’. This pollutes global scope and prevents showing uncaught exceptions and returning non zero exit code.
Sample code:
The above script should print an error and return 1. But it does nothing and returns 0.
It is the first import handling ‘uncaughtException’. Comment first line to get proper behaviour.
Another side effect is swallowing errors like this:
The above code also completes without notifying any issues.
It would be great if the module would not do this. See more information https://nodejs.org/docs/latest-v18.x/api/process.html#warning-using-uncaughtexception-correctly
The text was updated successfully, but these errors were encountered: