Skip to content

Intentional error management#2241

Open
jonathanKingston wants to merge 2 commits intomainfrom
jkt/auto/intentional-error-management-ded7
Open

Intentional error management#2241
jonathanKingston wants to merge 2 commits intomainfrom
jkt/auto/intentional-error-management-ded7

Conversation

@jonathanKingston
Copy link
Contributor

@jonathanKingston jonathanKingston commented Feb 5, 2026

Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/1199237043598868/task/1213132223643065?focus=true

Description

Introduces a new .mdc rule file (.cursor/rules/error-handling.mdc) to establish clear guidelines for intentional error management. This ensures that thrown errors and unhandled promise rejections are reserved for truly exceptional conditions (e.g., bugs, invariant violations) and are not used as part of normal code control flow. The goal is to improve code clarity, maintainability, and debugging by distinguishing between expected outcomes and actual errors.

Testing Steps

  • N/A - This change introduces a new .mdc guideline file. Review the content for clarity and accuracy.

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

Open in Cursor Open in Web


Note

Low Risk
Documentation-only change that adds engineering guidelines; it does not modify runtime code paths.

Overview
Adds a new always-applied Cursor guideline file, .cursor/rules/error-handling.mdc, that standardizes intentional error management.

The rule defines when throwing is acceptable (unreachable code, invariant violations, missing dependencies), discourages using errors for normal control flow, and sets expectations for handling promise rejections (no unhandled promises, explicit .catch()/try/catch, limited Promise.reject() usage), plus guidance on assertion-style checks and actionable error messages.

Written by Cursor Bugbot for commit 98251cf. This will update automatically on new commits. Configure here.

- Errors should represent exceptional conditions, not control flow
- Unhandled promise rejections must be avoided
- Documents valid uses: unreachable code, invariant violations, missing deps
- Includes anti-patterns to avoid and ESLint support notes

Co-authored-by: Jonathan Kingston <jonathanKingston@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Feb 5, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@netlify
Copy link

netlify bot commented Feb 5, 2026

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit 98251cf
🔍 Latest deploy log https://app.netlify.com/projects/content-scope-scripts/deploys/6985c35235d51f0008cf4e43
😎 Deploy Preview https://deploy-preview-2241--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

[Beta] Generated file diff

Time updated: Fri, 06 Feb 2026 10:33:47 GMT

@jonathanKingston jonathanKingston marked this pull request as ready for review February 6, 2026 09:25
@jonathanKingston jonathanKingston requested a review from a team as a code owner February 6, 2026 09:25
@jonathanKingston
Copy link
Contributor Author

jonathanKingston commented Feb 6, 2026

I actually think we should move this to ddg-workflow so other repos can take advantage of it.

Changed my mind, let's have it back but discussed shared mdc rules somewhere else that doesn't require ddg-workflow to be used (it should be optional).

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