Open
Conversation
- 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 Agent can help with this pull request. Just |
✅ Deploy Preview for content-scope-scripts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
Temporary Branch UpdateThe 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. |
Contributor
[Beta] Generated file diffTime updated: Fri, 06 Feb 2026 10:33:47 GMT |
Contributor
Author
|
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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/1199237043598868/task/1213132223643065?focus=true
Description
Introduces a new
.mdcrule 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
.mdcguideline file. Review the content for clarity and accuracy.Checklist
Please tick all that apply:
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, limitedPromise.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.