Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix - Failing to report issues via Blazor WebAssembly #2506

Merged
merged 3 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Fixed baggage propagation when an exception is thrown from middleware ([#2487](https://github.com/getsentry/sentry-dotnet/pull/2487))
- Fix Durable Functions preventing orchestrators from completing ([#2491](https://github.com/getsentry/sentry-dotnet/pull/2491))
- Re-enable HubTests.FlushOnDispose_SendsEnvelope ([#2492](https://github.com/getsentry/sentry-dotnet/pull/2492))
- Fixed the SDK failing to report issues via Blazor WebAssembly due to a `PlatformNotSupportedException` ([#2506](https://github.com/getsentry/sentry-dotnet/pull/2506))

### Dependencies

Expand Down
21 changes: 14 additions & 7 deletions src/Sentry/Internal/DebugStackTrace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,16 +440,23 @@ private static void DemangleLambdaReturnType(SentryStackFrame frame)
#if NET5_0_OR_GREATER && PLATFORM_NEUTRAL
// Maybe we're dealing with a single file assembly
// https://github.com/getsentry/sentry-dotnet/issues/2362
if (SingleFileApp.MainModule.IsBundle())
try
{
if (SingleFileApp.MainModule?.GetDebugImage(module) is not { } embeddedDebugImage)
if (SingleFileApp.MainModule.IsBundle())
{
options.LogInfo("Skipping embedded debug image for module '{0}' because the Debug ID couldn't be determined", moduleName);
return null;
}
if (SingleFileApp.MainModule?.GetDebugImage(module) is not { } embeddedDebugImage)
{
options.LogInfo("Skipping embedded debug image for module '{0}' because the Debug ID couldn't be determined", moduleName);
return null;
}

options.LogDebug("Got embedded debug image for '{0}' having Debug ID: {1}", moduleName, embeddedDebugImage.DebugId);
return embeddedDebugImage;
options.LogDebug("Got embedded debug image for '{0}' having Debug ID: {1}", moduleName, embeddedDebugImage.DebugId);
return embeddedDebugImage;
}
}
catch (PlatformNotSupportedException)
{
// Thrown by Blazor WASM (and possibly other platforms).
}
#endif

Expand Down