Skip to content

Report a catch that only discards its error - #1210

Merged
mergify[bot] merged 1 commit into
mainfrom
fix/explicit-failures-log-void
Sep 28, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
fix/explicit-failures-log-void

Conversation

@EdbertChan

@EdbertChan EdbertChan commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

A catch that only discards its error is the same silence as an empty catch.

The failure hook now reports that shape.

A catch that logs the error stays quiet.

Review Claim

The failure hook reports a catch that only discards its error, and stays quiet when the catch logs the error.

Review Lane

behavior

Review Unit

engine-runtime

Safety Invariant

The hook stays advisory. A catch that logs the exception is not reported.

Slice Rationale

This slice is only the hook. The skill text is the next pull request.

Non-goals

No change to the principle skill text.

Test Plan

Test Plan
  • python3 -m unittest discover -s engine/hooks/explicit-failures/tests -q
  • python3 scripts/ci/check_hook_test_coverage.py engine/hooks/explicit-failures

Revert Plan

Revert Plan
  • Safe to revert? Yes
  • Revert command: git revert 45754a29
  • Post-revert steps: Re-run python3 -m unittest discover -s engine/hooks/explicit-failures/tests -q.
  • Data migration? No

Note

Low Risk
Advisory-only hook behavior change with targeted regex and tests; no auth, data, or runtime execution impact.

Overview
Extends the explicit-failures PreToolUse scanner so JS/TS catch bodies made only of void <err> are reported as silent failures, alongside empty or bare-exit catches.

console.error is now treated like other explicit-handling tokens (log, raise, etc.), so catches that log (including void console.error(...)) stay suppressed. README and detect.py docs match the new rules.

Unit tests cover the new hit message and the no-report paths for console.error and void console.error.

Reviewed by Cursor Bugbot for commit 45754a2. Bugbot is set up for automated code reviews on this repo. Configure here.

A log line, including console.error, still counts as handling the exception.

Co-authored-by: Cursor <cursoragent@cursor.com>
Change-Id: I9440b5b3f39e69c99b032041d0f298b03c5f29f3
@cursor

cursor Bot commented Sep 28, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_8c402c7d-29de-4232-a8b4-0c6e4cd1f64e)

@mergify

mergify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@EdbertChan

Copy link
Copy Markdown
Owner Author

Mergify repair stopped: PR #1210 is ready to land, but upper stack PR(s) #1209 are open without admin-bypass; a human must decide whether to include them in the admin-bypass landing stack or land them separately.

@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 44 minutes 43 seconds in the queue, including 44 minutes 20 seconds running CI.

Required conditions to merge
  • check-success = lint
  • check-success = test
  • check-success = validate

@mergify mergify Bot added the queued label Sep 28, 2026
@mergify
mergify Bot merged commit ff035b8 into main Sep 28, 2026
7 checks passed
@mergify mergify Bot removed the queued label Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant