Skip to content

fix(frontend): decode blob error bodies so tools show the server's reason - #7619

Draft
posthog-eu[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixerrors-decode-blob-error-bodies-bd424f
Draft

fix(frontend): decode blob error bodies so tools show the server's reason#7619
posthog-eu[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixerrors-decode-blob-error-bodies-bd424f

Conversation

@posthog-eu

@posthog-eu posthog-eu Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

Why

  • Users who hit a server error in any PDF tool saw the generic toast "Server error: There was an error processing your request." instead of the server's reason. On merge, they retried, rage clicked, and gave up.
  • This is live on the hosted product, not only self-hosted. Rage clicks on /merge are the one measurable proxy, and none of these failures reach error tracking.

What changed

  • handleHttpError built the toast from error.response.data before the Blob was decoded. Every tool POST sets responseType: "blob", so at that point the body was an unread Blob: JSON.stringify(Blob) returns "{}", the message was rejected as unhelpful, and it fell back to the generic text — the decoded server explanation was then never used for the toast.
  • Decode the response body once, up front, and pass the decoded body into extractAxiosErrorMessage.
  • extractAxiosErrorMessage now takes an optional decoded-body argument and prefers it over the raw error.response.data.

Impact

  • Repairs error legibility for every tool that posts with responseType: "blob", not merge alone.
  • The underlying merge 500 is now diagnosable, because the server message reaches the toast.

Tests

  • Added httpErrorHandler.test.ts: a blob error body (JSON and plain text) now surfaces the server message in the toast instead of the generic fallback.

Checklist

General

Documentation

Translations (if applicable)

UI Changes (if applicable)

  • Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR)

Testing (if applicable)

  • I have run task check to verify linters, typechecks, and tests pass
  • I have tested my changes locally. Refer to the Testing Guide for more details.

Created with PostHog Desktop from this inbox report.

Tool POSTs use responseType "blob", so error.response.data reaches
handleHttpError as an unread Blob. The toast message was built from that raw
Blob before the blob was decoded, so JSON.stringify(Blob) returned "{}", the
message was rejected as unhelpful, and every server error fell back to the
generic "There was an error processing your request." text.

Decode the response body once, up front, and pass the decoded body into
extractAxiosErrorMessage. The server explanation now reaches the toast for
every tool that posts with responseType blob, which also makes the merge 500
diagnosable.

Generated-By: PostHog Desktop
Task-Id: 1544e247-e89a-478f-8b54-6fce70390e6a
@github-actions github-actions Bot added Front End Issues or pull requests related to front-end development Bugfix Pull requests that fix bugs has conflicts Pull request has merge conflicts with the base branch labels Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix Pull requests that fix bugs Front End Issues or pull requests related to front-end development has conflicts Pull request has merge conflicts with the base branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants