Skip to content

fix: report failure for non-Error rejections in run()#60

Merged
ben-miru merged 1 commit into
mainfrom
fix/handle-non-error-rejections
May 15, 2026
Merged

fix: report failure for non-Error rejections in run()#60
ben-miru merged 1 commit into
mainfrom
fix/handle-non-error-rejections

Conversation

@miru-agents

Copy link
Copy Markdown
Collaborator

Summary

run() in src/main.ts only called core.setFailed when the caught value was an Error instance:

} catch (error) {
  if (error instanceof Error) core.setFailed(error.message)
}

If anything in run() rejected/threw a non-Error value (a string, a plain object, etc.), the catch swallowed it silently: core.setFailed was never called, run() resolved normally, and the action exited 0 reporting success even though the Miru CLI was never installed. Downstream workflow steps then ran without the CLI on PATH, turning an install failure into a confusing later failure or silent misbehavior.

Changes

  • src/main.ts: any thrown value now triggers core.setFailederror.message for Error instances (behavior/message unchanged), String(error) otherwise.
  • __tests__/main.test.ts: added a test covering the non-Error rejection path.
  • dist/: regenerated bundle (committed build output for the action).

Test plan

  • npm run lint clean
  • npm run ci-test — 34/34 pass, 100% coverage, including the new non-Error rejection test
  • npm run packagedist/ rebuilt with the fix
  • Existing handles download error / handles extraction error tests still pass (Error message path unchanged)

Generated by Claude Code

The catch block in run() only called core.setFailed when the thrown
value was an Error instance. Non-Error rejections (strings, plain
objects) were swallowed silently, so the action exited 0 reporting
success even though the Miru CLI was never installed, leaving
downstream workflow steps running without the CLI on PATH.

Now any thrown value triggers core.setFailed, using error.message for
Error instances and String(error) otherwise.
@ben-miru ben-miru merged commit c4bbaf2 into main May 15, 2026
27 checks passed
@ben-miru ben-miru deleted the fix/handle-non-error-rejections branch May 15, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants