Skip to content

Removed unnecessary Sentry captures for HTML parse failures#26891

Merged
kevinansfield merged 1 commit intomainfrom
worktree-mobiledoc-parse-handling
Mar 24, 2026
Merged

Removed unnecessary Sentry captures for HTML parse failures#26891
kevinansfield merged 1 commit intomainfrom
worktree-mobiledoc-parse-handling

Conversation

@kevinansfield
Copy link
Member

closes https://linear.app/ghost/issue/BER-3441/

HTML-to-mobiledoc/lexical parse errors from ?source=html requests are client input validation failures, not unexpected server errors. The explicit sentry.captureException() calls were reporting these to Sentry before re-throwing as ValidationError (422), causing excessive noise when integrations retry bad requests. The ValidationError alone is sufficient — clients get a proper 422 and Ghost's error middleware already knows not to report 4xx errors to Sentry.

closes https://linear.app/ghost/issue/BER-3441/
HTML-to-mobiledoc/lexical parse errors are client input validation
failures, not unexpected server errors. The explicit
sentry.captureException() calls were sending these to Sentry before
re-throwing as ValidationError (422), causing excessive noise when
integrations retry bad requests.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a1eff708-b766-4567-99c1-7fcd3258fecb

📥 Commits

Reviewing files that changed from the base of the PR and between 4a43d34 and fb0c853.

📒 Files selected for processing (2)
  • ghost/core/core/server/api/endpoints/utils/serializers/input/pages.js
  • ghost/core/core/server/api/endpoints/utils/serializers/input/posts.js
💤 Files with no reviewable changes (2)
  • ghost/core/core/server/api/endpoints/utils/serializers/input/posts.js
  • ghost/core/core/server/api/endpoints/utils/serializers/input/pages.js

Walkthrough

This pull request removes Sentry error reporting integration from two serializer files. The sentry module dependency was removed from both pages.js and posts.js, and the corresponding sentry.captureException(err) calls within HTML-to-Mobiledoc and HTML-to-Lexical conversion error handlers were deleted. Error handling logic remains unchanged—validation errors continue to be thrown with appropriate messages and error payloads, but exceptions are no longer reported to Sentry. This results in 3 lines removed from each file with no changes to exported or public entity declarations.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing unnecessary Sentry captures for HTML parse failures, which directly matches the modifications in both pages.js and posts.js.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for removing Sentry capture calls from HTML parsing error handlers and the business context for the change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-mobiledoc-parse-handling
📝 Coding Plan
  • Generate coding plan for human review comments

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

@kevinansfield kevinansfield merged commit e5b4f34 into main Mar 24, 2026
35 checks passed
@kevinansfield kevinansfield deleted the worktree-mobiledoc-parse-handling branch March 24, 2026 09:55
cmraible pushed a commit that referenced this pull request Mar 25, 2026
closes https://linear.app/ghost/issue/BER-3441/

HTML-to-mobiledoc/lexical parse errors from `?source=html` requests are
client input validation failures, not unexpected server errors. The
explicit `sentry.captureException()` calls were reporting these to
Sentry before re-throwing as `ValidationError` (422), causing excessive
noise when integrations retry bad requests. The `ValidationError` alone
is sufficient — clients get a proper 422 and Ghost's error middleware
already knows not to report 4xx errors to Sentry.
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