[superlog] Set correct HTTP status on custom ORPC error codes to suppress false-positive ERRORs#509
Merged
Conversation
…ress false-positive ERRORs
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
The latest updates on your projects. Learn more about Unkey Deploy
|
Contributor
izadoesdev
approved these changes
Jun 30, 2026
izadoesdev
left a comment
Member
There was a problem hiding this comment.
Reviewed against staging. No blocking findings. This is a small, targeted status propagation fix: the three custom ORPC helpers now match the statuses already declared in baseErrors, which keeps expected 4xx outcomes from being logged as false-positive ERROR incidents. CI is green.
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.
Summary
Users hitting plan limits, feature gates, or rate limits on the API triggered false-positive ERROR-level Superlog incidents. The root cause is that three Databuddy-custom ORPC error codes —
PLAN_LIMIT_EXCEEDED,FEATURE_UNAVAILABLE, andRATE_LIMITED— are not in ORPC's built-in status table, soORPCErrordefaulted their HTTP status to 500 instead of 402 / 403 / 429.The existing downgrade in
apps/api/src/lib/evlog-api.ts(normalizeWideEventForAxiom) already correctly demotes any error with a 4xx status from ERROR to WARN before it reaches Superlog or Axiom. But because the status was 500, the guard (status >= 400 && status < 500) never fired, and every plan-limit hit became an incident.The fix passes the correct
statusin theORPCErrorconstructor for each of the three affected helpers inpackages/rpc/src/errors.ts, matching whatbaseErrorsalready declares for these codes. No logic change — only the status propagation that was missing.Incident on Superlog
Was this PR helpful? Leave feedback — goes straight to the Superlog team.
Summary by cubic
Set correct HTTP status codes for custom ORPC errors to stop false-positive ERROR incidents in Superlog.
FEATURE_UNAVAILABLE→ 403,RATE_LIMITED→ 429, andPLAN_LIMIT_EXCEEDED→ 402 so 4xx errors are demoted to WARN as intended.statustoORPCErrorinpackages/rpc/src/errors.ts.Written for commit 3aca67a. Summary will update on new commits.