Normalise non-Error values before reporting to Sentry - #1323
Merged
Conversation
|
Preview build will be at |
microbit-matt-hillsdon
added this pull request to stack #1324
September 10, 2026 12:37
The simulator's internal_error message carries Emscripten's ExitStatus,
a plain constructor that does not extend Error. After structured cloning
over postMessage it is a bare {name, message, status} object, which
Sentry titles "Object captured as exception with keys: ..." and groups
together regardless of cause.
reportError now converts any non-Error into an Error carrying the
original name and message, with remaining fields merged into extra
alongside any caller-supplied context. The synthesised stack is dropped
because it would only show the logging call chain, identical for every
caller, and Sentry would group unrelated errors together on it.
Fixes #1319
microbit-matt-hillsdon
force-pushed
the
sentry-normalise-errors
branch
from
September 10, 2026 13:17
48a0385 to
e05bb4b
Compare
Collaborator
Author
|
It's questionable whether ExitStatus is intended to be reported by this channel. But it's super opaque in Sentry as-is. So let's start with this and confirm what we're actually seeing, then likely dive down a layer into the sim. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The simulator's internal_error message carries Emscripten's ExitStatus, a plain constructor that does not extend Error. After structured cloning over postMessage it is a bare {name, message, status} object, which Sentry titles "Object captured as exception with keys: ..." and groups together regardless of cause.
reportError now converts any non-Error into an Error carrying the original name and message, with remaining fields merged into extra alongside any caller-supplied context. The synthesised stack is dropped because it would only show the logging call chain, identical for every caller, and Sentry would group unrelated errors together on it.
Fixes #1319