Skip to content

🥅 server: fingerprint api errors by response message#781

Merged
cruzdanilo merged 1 commit intomainfrom
catch
Feb 16, 2026
Merged

🥅 server: fingerprint api errors by response message#781
cruzdanilo merged 1 commit intomainfrom
catch

Conversation

@cruzdanilo
Copy link
Member

@cruzdanilo cruzdanilo commented Feb 16, 2026


Open with Devin

Summary by CodeRabbit

  • Bug Fixes

    • Improved error reporting to capture richer identifiers from API error responses.
    • Standardized and simplified error message formatting for failed HTTP responses.
    • Removed request URLs from error texts to reduce noisy details.
  • Tests

    • Updated test expectations to match simplified error message formatting.
  • Chores

    • Added a changeset entry marking a patch release.

@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: 00f96dc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@exactly/server Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link

Summary of Changes

Hello @cruzdanilo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a refined error handling mechanism specifically for 'panda' related errors. By creating a custom fingerprinting utility, the system can now categorize and group these errors more effectively based on their API message and status. This enhancement aims to improve the clarity and actionability of error reports, making it easier to identify and address recurring issues.

Highlights

  • Improved Error Fingerprinting: Implemented a new utility function to generate specific fingerprints for 'panda' related errors, enhancing error grouping in Sentry.
  • Centralized Error Handling Integration: Integrated the new panda error fingerprinting into the application's global error handler, ensuring all relevant errors are processed.
  • Dynamic Error Identification: The fingerprinting logic extracts the HTTP status and, if available, the API message from the error body to create more granular error identifiers.
Changelog
  • .changeset/crrd-qcdf-qxin.md
    • Added a new changeset entry documenting the fingerprinting of panda errors by API message.
  • server/index.ts
    • Imported the new fingerprint utility from server/utils/panda.
    • Applied the fingerprintPanda function to the captureException call within the global error handler, enabling custom fingerprinting for errors.
  • server/utils/panda.ts
    • Added a new fingerprint function that extracts status and API message from error objects, specifically targeting errors originating from 'panda.ts' files.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Parse thrown Error.message in app.onError to derive a Sentry-style fingerprint (status + optional body field) and pass it to captureException; simplify non-OK fetch error message formatting in two HTTP helpers; update tests and add a changeset for the patch.

Changes

Cohort / File(s) Summary
Server error capture
server/index.ts
app.onError now inspects thrown Error.message to extract a 3-digit status and an optional body segment, attempts to parse the body JSON to pick a code/error/message string, builds a fingerprint array (including a default prefix and status and optional field), and passes it to captureException alongside existing metadata. Response handling unchanged.
HTTP helper formatting
server/utils/ramps/manteca.ts, server/utils/sardine.ts
Non-OK fetch responses now raise Error messages in plain "<status> <response-text>" form, removing the prior leading ::...:: wrapper and (in sardine) omitting the URL from the message. No change to control flow.
Tests updated
server/test/utils/manteca.test.ts
Mocks and assertions updated to expect the new, shorter error-message format (removed :: prefixes and adjusted strings accordingly).
Changeset
.changeset/twenty-bananas-cheer.md
Add a changeset documenting a patch for @exactly/server with note "🥅 fingerprint api errors by response message."

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Client
participant ServerApp as Server (app)
participant Parser as ErrorParser
participant Sentry as captureException
Client->>ServerApp: request triggers thrown Error
ServerApp->>Parser: inspect Error.message (extract status, body)
Parser-->>ServerApp: fingerprint array (["{{ default }}", status, optional field])
ServerApp->>Sentry: captureException(error, metadata, fingerprint)
Sentry-->>ServerApp: ack
ServerApp-->>Client: original response (unchanged)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly relates to the main change: fingerprinting API errors by response message in the server code, which matches the core modifications across server/index.ts and error handling utilities.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch catch

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.

❤️ Share

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

gemini-code-assist[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@sentry
Copy link

sentry bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.05%. Comparing base (fc1081d) to head (00f96dc).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
server/utils/sardine.ts 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #781      +/-   ##
==========================================
- Coverage   69.50%   69.05%   -0.46%     
==========================================
  Files         207      207              
  Lines        7202     7012     -190     
  Branches     2256     2205      -51     
==========================================
- Hits         5006     4842     -164     
+ Misses       2007     1992      -15     
+ Partials      189      178      -11     
Flag Coverage Δ
e2e 69.02% <50.00%> (-0.46%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@cruzdanilo cruzdanilo changed the title 🥅 server: fingerprint panda errors by api message 🥅 server: fingerprint api errors by response message Feb 16, 2026
@sentry
Copy link

sentry bot commented Feb 16, 2026

Sentry Issue: SERVER-FA

devin-ai-integration[bot]

This comment was marked as resolved.

sentry[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

@cruzdanilo cruzdanilo merged commit 00f96dc into main Feb 16, 2026
13 of 15 checks passed
@cruzdanilo cruzdanilo deleted the catch branch February 16, 2026 04:03
@sentry
Copy link

sentry bot commented Feb 16, 2026

Issues attributed to commits in this pull request

This pull request was merged and Sentry observed the following issues:

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

Comments