Skip to content

fix: preserve the cause of turbo-stream decode failures - #15450

Open
Jiralite wants to merge 1 commit into
remix-run:mainfrom
Jiralite:fix/preserve-turbo-stream-decode-cause
Open

fix: preserve the cause of turbo-stream decode failures#15450
Jiralite wants to merge 1 commit into
remix-run:mainfrom
Jiralite:fix/preserve-turbo-stream-decode-cause

Conversation

@Jiralite

Copy link
Copy Markdown

I, personally, am uncommonly catching these errors in Sentry. I would like to debug further, but I cannot, because the actual error is not surfaced.

This pull request attaches a cause to the error to help surface the issue.

This pattern is already used elsewhere in the codebase:

} catch (cause) {
// Can't clone after consuming the body via decode so we can't include the
// body here. In an ideal world we'd look for an RSC content type here,
// or even X-Remix-Response but then folks can't statically deploy their
// prerendered .rsc files to a CDN unless they can tell that CDN to add
// special headers to those certain files - which is a bit restrictive.
throw new Error("Unable to decode RSC response", { cause });
}

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