Skip to content

fix(core): harden router guard error handling and param validation#199

Merged
RtlZeroMemory merged 1 commit intomainfrom
guardrails/router-guards
Feb 25, 2026
Merged

fix(core): harden router guard error handling and param validation#199
RtlZeroMemory merged 1 commit intomainfrom
guardrails/router-guards

Conversation

@RtlZeroMemory
Copy link
Owner

Summary

  • Wrap route guard invocations in try-catch, converting exceptions to ZRUI_USER_CODE_THROW with the originating route ID
  • Warn in dev mode when route params contain non-string values that get silently coerced
  • Warn in dev mode when route IDs contain non-identifier characters

Files changed

  • router/integration.ts — guard error wrapping
  • router/router.ts — param type warnings, route ID character validation

- Wrap route guard invocations in try-catch, converting exceptions to
  ZRUI_USER_CODE_THROW with the originating route ID
- Warn in dev mode when route params contain non-string values that
  will be silently coerced
- Warn in dev mode when route IDs contain non-identifier characters

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

Warning

Rate limit exceeded

@RtlZeroMemory has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 21 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between ff26087 and 40af6d3.

📒 Files selected for processing (2)
  • packages/core/src/router/integration.ts
  • packages/core/src/router/router.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch guardrails/router-guards

Comment @coderabbitai help to get the list of available commands and usage tips.

@RtlZeroMemory RtlZeroMemory merged commit 0d5d127 into main Feb 25, 2026
31 checks passed
@RtlZeroMemory RtlZeroMemory deleted the guardrails/router-guards branch February 25, 2026 04:54
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.

1 participant