fix: bin/run error handling path for oclif v4#830
Conversation
There was a problem hiding this comment.
🤖 PR Reviewer
The fix correctly addresses a real bug where module objects were being passed instead of functions to .then() and .catch(), which would silently drop error handling. The e2e test is well-structured and validates the regression. The changes are minimal, clear, and correct.
✅ LGTM! This PR looks good to merge.
💡 How to re-trigger
Comment /review or /pr-reviewer on this PR
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
pru55e11
left a comment
There was a problem hiding this comment.
One nit before merge: the title uses feat: but this is a bug fix — with our np/semantic-release flow feat: cuts a minor version when it should be a patch. Can we retitle to fix: bin/run error handling path for oclif v4? (Squash-merge title matters since that's what lands on the commit.)
yes we can retitle it to |
Description
@oclif/core/handleand@oclif/core/flushexpose handle and flush as named exports from their subpath modules. The previous code was passing the module object directly into .then() / .catch(), which means the intended handlers were not actually being called correctly.As a result, errors could escape to Node’s default uncaught exception printer instead of going through oclif’s normal error renderer.
The fix explicitly destructures handle and flush and passes the actual functions into the promise chain
This keeps CLI error handling consistent and avoids leaking raw stack traces in cases where oclif should render a cleaner user-facing error.
Related Issue
https://jira.corp.adobe.com/browse/ACNA-4659
Closes #829
Motivation and Context
aiocurrently shows raw Node.js stack traces for CLI errors instead of oclif’s clean error output. The root cause is thatbin/runpasses the@oclif/core/handleand@oclif/core/flushmodule objects instead of the actual named functions exported by@oclif/corev4.Because of that, error handling is skipped and user-facing validation/runtime errors are displayed as noisy stack traces. This PR fixes the wiring by passing the actual
handleandflushfunctions, restoring clean CLI error rendering and making command failures easier to understand.How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: