fix: filter out intentional user-input errors from report-error#8178
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughA guard clause was added to the Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/utils/telemetry/report-error.ts (1)
31-35: Prefer self-explanatory code instead of behavior comments in this block.The three inline comments can be replaced by a clear predicate variable name; this also keeps the check aligned with the normalized
errvariable.♻️ Proposed refactor
- // `@netlify/config` tags intentional user-input errors (malformed netlify.toml, - // invalid redirects, etc.) with this shape. See `@netlify/config/lib/error.js`. - // These are not CLI bugs and don't belong in Bugsnag. - if (error?.customErrorInfo?.type === 'resolveConfig') { + const isResolveConfigUserError = err?.customErrorInfo?.type === 'resolveConfig' + if (isResolveConfigUserError) { return }As per coding guidelines,
**/*.{ts,tsx,js,jsx}: Never write comments on what the code does; make the code clean and self-explanatory instead.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/utils/telemetry/report-error.ts` around lines 31 - 35, Replace the inline comments and raw check with a self-explanatory predicate: create a const like isResolveConfigError (or isNetlifyConfigError) that evaluates the normalized err?.customErrorInfo?.type === 'resolveConfig' and use that predicate in the early return inside reportError (replace the current if (error?.customErrorInfo?.type === 'resolveConfig') return). This keeps the logic aligned with the normalized err variable and removes explanatory comments while preserving behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/utils/telemetry/report-error.ts`:
- Around line 31-35: Replace the inline comments and raw check with a
self-explanatory predicate: create a const like isResolveConfigError (or
isNetlifyConfigError) that evaluates the normalized err?.customErrorInfo?.type
=== 'resolveConfig' and use that predicate in the early return inside
reportError (replace the current if (error?.customErrorInfo?.type ===
'resolveConfig') return). This keeps the logic aligned with the normalized err
variable and removes explanatory comments while preserving behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8f992d25-2f0e-4037-9b78-f095c4f85a97
📒 Files selected for processing (1)
src/utils/telemetry/report-error.ts
🤖 I have created a release *beep* *boop* --- ## [25.1.1](v25.1.0...v25.1.1) (2026-04-21) ### Bug Fixes * filter out intentional user-input errors from report-error ([#8178](#8178)) ([7c50c25](7c50c25)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com>
🎉 Thanks for submitting a pull request! 🎉
Summary
In our error report tool I'm seeing a lot of toml configuration errors. In my opinion our bug reporting should contain events that an engineer on-call could investigate as a potential bug. Everything currently in there that doesn't meet that bar is pollution. We should filter intentional user-input errors out in our error reporting.
For us to review and ship your PR efficiently, please perform the following steps:
passes our tests.
A picture of a cute animal (not mandatory, but encouraged)