fix(webapp): downgrade expected user-input error logs to warn#3523
fix(webapp): downgrade expected user-input error logs to warn#3523
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
🧰 Additional context used📓 Path-based instructions (9)**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
{packages/core,apps/webapp}/**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.ts📄 CodeRabbit inference engine (.cursor/rules/otel-metrics.mdc)
Files:
apps/webapp/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)
Files:
{apps,internal-packages}/**/*.{ts,tsx,js}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
{package.json,**/*.{ts,tsx,js}}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js,jsx,json,md,css,scss}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (2)📚 Learning: 2026-03-22T13:26:12.060ZApplied to files:
📚 Learning: 2026-03-22T19:24:14.403ZApplied to files:
🪛 LanguageTool.server-changes/sentry-wrapper-bypass-fix.md[grammar] ~6-~6: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) 🔇 Additional comments (3)
WalkthroughThe PR updates error handling in nine webapp route handlers and two backend services. Catch blocks were refactored to distinguish expected, user-facing errors (ServiceValidationError, OutOfEntitlementError, CreateDeclarativeScheduleError, QueryError) — which are now logged at warn level and return 4xx responses — from unexpected failures, which remain logged at error level and return 500 responses. A changelog entry (.server-changes/sentry-wrapper-bypass-fix.md) documents that these sites no longer escalate expected input errors to error-level Sentry events. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…rs to warn ServiceValidationError and CreateDeclarativeScheduleError are user-facing validation failures returned as 4xx; they shouldn't surface in Sentry. Move type discrimination before the log call and split the SVE/CDSE branches at warn level. Real 5xx errors continue to log at error. Refs the ignoreErrors filter added in dac9c83; closes the wrapper-bypass gap on TRIGGER-CLOUD-2S. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rkers to warn Same wrapper-bypass pattern as the projects-scoped sibling; both feed TRIGGER-CLOUD-2S. Type-discriminate before the log; warn for SVE and CreateDeclarativeScheduleError, error for unknown. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes the wrapper-bypass gap on TRIGGER-CLOUD-38 (Batch trigger error, 755 events in 48h). Customer-facing 422 paths now log at warn; only the 500 fall-through escalates to Sentry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same wrapper-bypass shape as the v1 sibling. Customer-facing 422 paths now log at warn; only the 500 fall-through escalates to Sentry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
31286c1 to
3c7dceb
Compare
993fa70 to
817ef6b
Compare
Customer-facing 422 paths now log at warn; only the 500 fall-through escalates to Sentry. Rate-limit (BatchProcessingError 429) branch above is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…s to warn Closes the wrapper-bypass gap on TRIGGER-CLOUD-103 (Stream batch items error, 1052 events in 48h). Customer-facing 4xx paths (invalid item shape, invalid JSON in stream body) now log at warn; only the 500 fall-through escalates to Sentry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
QueryError surfaces customer SQL problems and is returned as 400; not a system bug. Type-discriminate before the log call; warn for QueryError, error for unknown failures. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ker to warn Customer schedule-config failures (typically invalid cron) get rethrown to the route handler as ServiceValidationError; that's a 4xx, not a system bug. Split the SVE branch out and log at warn before rethrowing. Non-SVE failures still log at error before being wrapped, mirroring dac9c83's waitpointCompletionPacket.server.ts pattern so visibility survives the SDK-level SVE filter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…kgroundWorkerV4 to warn Mirrors the createBackgroundWorker fix; same wrap-into-SVE shape, same split: warn + rethrow for SVE, error + wrap-and-throw for unknown. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
817ef6b to
3c06288
Compare
dac9c83bdaddedignoreErrors: /^ServiceValidationError(?::|$)/inapps/webapp/sentry.server.tsto drop SVEs before they reach Sentry. Thefilter only matches when the captured event's type is
ServiceValidationError, but nine call sites in the webapp catch SVE (andanalogous user-input error types —
OutOfEntitlementError,CreateDeclarativeScheduleError,QueryError) and calllogger.error("wrapper message", { error: e })before the type check.The captured event is then titled with the wrapper message, with the inner
error buried in
extra.error— invisible to the SDK filter. Result: asteady stream of expected user-input failures escalating as
error-levelevents when they should be
warn.Each catch block now type-discriminates first, logs expected types at
warn,and keeps unknown-error fall-throughs at
error. For service sites thatwrap into SVE (
createBackgroundWorker,createDeploymentBackgroundWorkerV4),the inner error is logged at
errorbefore wrapping — mirrors thewaitpointCompletionPacket.server.tspattern fromdac9c83bd.