Skip to content

[eslint-monster] [Code Quality] actions/setup/js: normalize error-handling patterns flagged by custom ESLint rules #46095

Description

@github-actions

Summary

npm run lint:setup-js reports a second remediation stream in actions/setup/js around reusable error-handling patterns: rethrows without { cause }, unchecked spawnSync(...).error, unsafe caught-error property access, and places that should use getErrorMessage(err). This issue should address those related diagnostics together where they share the same root cause of inconsistent exception handling.

Affected files

Representative files from the current lint run:

  • actions/setup/js/apply_samples.cjs
  • actions/setup/js/artifact_client.cjs
  • actions/setup/js/assign_to_agent.cjs
  • actions/setup/js/awf_reflect.cjs
  • actions/setup/js/copilot_harness.cjs
  • actions/setup/js/create_issue.cjs
  • actions/setup/js/handle_agent_failure.cjs
  • actions/setup/js/merge_remote_agent_github_folder.cjs
  • actions/setup/js/run_evals.cjs
  • actions/setup/js/safe_output_handler_manager.cjs

Representative diagnostics

  • apply_samples.cjs:67:11 — rethrow inside catch (err) should include { cause: err }
  • apply_samples.cjs:97:18spawnSync result must check .error
  • artifact_client.cjs:163:18spawnSync result must check .error
  • awf_reflect.cjs:209:71 — prefer getErrorMessage(err)
  • copilot_harness.cjs:269:9 — unsafe direct access to caught error .code
  • run_evals.cjs:63:85 — unsafe direct access to caught error .message
  • safe_output_handler_manager.cjs:283:11 — rethrow should include { cause: error }

Expected outcome

  • Rethrown errors preserve original causes
  • spawnSync call sites check and handle .error before relying on status
  • Caught-error reporting uses safe helpers or guards
  • Related actions/setup/js files stop triggering the associated custom error-handling rules

Checklist

  • Add { cause } to rethrows that reference caught errors
  • Check spawnSync(...).error at flagged call sites
  • Replace unsafe caught-error property access with safe guards/helpers
  • Prefer getErrorMessage(err) where the custom rule expects it
  • Keep changes scoped to actions/setup/js
  • Run npm run lint:setup-js

Source

Daily ESLint Monster remediation stream from workflow run 29538839244.

Generated by 🧹 ESLint Monster · 15.6 AIC · ⌖ 8.47 AIC · ⊞ 3.9K ·

  • expires on Jul 23, 2026, 2:22 PM UTC-08:00

Metadata

Metadata

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions