Repository navigation
Commit d366df4
fix(catalog): Prevent ApiClientError from being logged as server bug (#1155)
The `update_project` tool in
`packages/mcp-core/src/tools/catalog/update-project.ts` was
unconditionally calling `logIssue(err)` in its catch block. This led to
`ApiClientError` instances (which represent 4xx HTTP responses due to
invalid user input, e.g., bad slugs) being reported to Sentry as
high-priority server bugs.
This change modifies the catch block to check if the error is an
`ApiClientError`. If it is, the error is re-thrown directly, allowing
the MCP framework's existing error handling (which correctly formats
`ApiClientError` as an "Input Error" for the user and does not log it to
Sentry) to take over. This prevents expected user input validation
errors from cluttering Sentry with false positives.
Fixes
[MCP-SERVER-G3D](https://sentry.sentry.io/issues/7608940636/?seerDrawer=true)
<sub>Comment `@sentry <feedback>` on this PR to have Autofix iterate on
the changes.</sub>
---------
Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>1 parent b0863cd commit d366df4
2 files changed
Lines changed: 37 additions & 0 deletions
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
26 | 59 | | |
27 | 60 | | |
28 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| |||
0 commit comments