Skip to content

Use invariant assertions with descriptive error messages#14

Closed
mass2527 wants to merge 2 commits intomainfrom
claude/use-invariant-assertions-yytHN
Closed

Use invariant assertions with descriptive error messages#14
mass2527 wants to merge 2 commits intomainfrom
claude/use-invariant-assertions-yytHN

Conversation

@mass2527
Copy link
Owner

Replace throw statements with invariant() calls for internal state
validation. Update all existing invariant calls to use more
descriptive error messages that explain the context and expected state.

Replace throw statements with invariant() calls for internal state
validation. Update all existing invariant calls to use more
descriptive error messages that explain the context and expected state.
@claude
Copy link

claude bot commented Jan 24, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Update all invariant assertions to follow a consistent pattern that
describes the context and requirements rather than just the code state.

Messages now explain:
- What operation requires the condition (e.g., "removePanel requires...")
- The broader context for why the condition must hold
- User-friendly descriptions without implementation details
@mass2527 mass2527 closed this Feb 2, 2026
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.

2 participants

Comments