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
@alessandrotesoro Thanks for filing an issue. oclif/core captures and returns hook failures, meaning that hooks cannot exit the process (you can see the code here). This is different from the now deprecated oclif/config which allowed hooks exit the process by throwing an error.
We made this decision primarily because the Salesforce CLI depends heavily on custom hooks and we didn't want to allow one failed hook to exit the entire process.
We're open, however, to support some sort of toggle that will allow hooks to exit if there's a strong enough demand for it. We'd also be willing to review and merge a PR if you would like to take that work up yourself.
In the meantime, I'm going to transfer this issue to the oclif/core repo since that is where any change would be implemented.
Activity
mdonnalley commentedon Oct 6, 2022
@alessandrotesoro Thanks for filing an issue. oclif/core captures and returns hook failures, meaning that hooks cannot exit the process (you can see the code here). This is different from the now deprecated oclif/config which allowed hooks exit the process by throwing an error.
We made this decision primarily because the Salesforce CLI depends heavily on custom hooks and we didn't want to allow one failed hook to exit the entire process.
We're open, however, to support some sort of toggle that will allow hooks to exit if there's a strong enough demand for it. We'd also be willing to review and merge a PR if you would like to take that work up yourself.
In the meantime, I'm going to transfer this issue to the oclif/core repo since that is where any change would be implemented.
cristiand391 commentedon Dec 5, 2022
Hey @shrutiburman, as Mike mentioned, oclif/core captures the hook failure.
If you want to make the CLI exit if the hook failed you should be able to do that where the hook is fired, see this PR for an example:
https://github.com/salesforcecli/sfdx-cli/pull/677/files
you can make the CLI throw an err for all failures or filter by plugins.
shrutiburman commentedon Dec 5, 2022
I'll check it out, thanks!
git2gus commentedon Feb 8, 2023
This issue has been linked to a new work item: W-12514447