Skip to content

Require a log when a caught exception is not rethrown. - #1222

Merged
mergify[bot] merged 1 commit into
mainfrom
stack/EdbertChan/pr/explicit-failures-void-and-log/require-log-caught-exception-rethrown--8409b8f5
Sep 29, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
stack/EdbertChan/pr/explicit-failures-void-and-log/require-log-caught-exception-rethrown--8409b8f5

Conversation

@EdbertChan

@EdbertChan EdbertChan commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

A catch that only throws the error away must now write a log. The log has to name what failed and keep the original error. A comment or a void line does not count. The skill text and its test both say that.

Review Claim

The skill now says a caught error must be logged, and the test checks the same void and logged cases the hook already checks.

Review Lane

behavior

Review Unit

corpus-lesson

Safety Invariant

A catch that only discards the error is not a handled error. The skill text matches the hook that is already on main.

Slice Rationale

The hook change is already on main. This pull request is only the skill text and the test that reads that hook.

Non-goals

  • No change to the failure hook.
  • No change to runtime behavior.

Test Plan

Test Plan
  • python3 -m unittest corpus/skills/principle-explicit-errors/tests/test_void_discard.py -q

Revert Plan

Revert Plan
  • Safe to revert? Yes
  • Revert command: git revert 96d5f912
  • Post-revert steps: None
  • Data migration? No

Note

Low Risk
Documentation and corpus tests only; no production pipeline or hook logic changes in the diff.

Overview
Tightens the principle-explicit-errors skill so caught exceptions may not be silently dropped: disposition must be fail fast, propagate, translate to a domain result, or log with the original exception. It explicitly bans empty/comment-only handlers and discard-only patterns (void err, except: pass, etc.), and states that comments are not logs.

The Grounding section no longer treats Zen of Python’s “unless explicitly silenced” as permission to suppress; non-propagating paths must log.

fires_example.md now covers both empty catch {} and swapping void reportingFailure for an empty catch—neither is OK without logging—and expects tests on the log.

test_void_discard.py locks the skill to engine/hooks/explicit-failures: void-only catches are flagged; catches that console.error the error are not.

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

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

cursor Bot commented Sep 29, 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_578df34c-5142-4497-aabc-12b2eae49864)

@mergify

mergify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

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

@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 44 minutes 57 seconds in the queue, including 44 minutes 35 seconds running CI.

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

@mergify mergify Bot added the queued label Sep 29, 2026
@mergify
mergify Bot merged commit 5fa51a4 into main Sep 29, 2026
8 checks passed
@mergify mergify Bot removed the queued label Sep 29, 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