Skip to content

Commit 1497b61

Browse files
Review feedback
1 parent 2d22ca3 commit 1497b61

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/Sentry/Platforms/Cocoa/RuntimeMarshalManagedExceptionIntegration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void Register(IHub hub, SentryOptions options)
2828
[SecurityCritical]
2929
internal void Handle(object sender, MarshalManagedExceptionEventArgs e)
3030
{
31-
_options?.LogDebug("Runtime Marshal Managed Exception");
31+
_options?.LogDebug("Runtime Marshal Managed Exception mode {0}", e.ExceptionMode.ToString("G"));
3232

3333
if (e.Exception is { } ex)
3434
{

src/Sentry/Platforms/Cocoa/SentrySdk.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ private static void InitSentryCocoaSdk(SentryOptions options)
148148
// When we have an unhandled managed exception, we send that to Sentry twice - once managed and once native.
149149
// The managed exception is what a .NET developer would expect, and it is sent by the Sentry.NET SDK
150150
// But we also get a native SIGABRT since it crashed the application, which is sent by the Sentry Cocoa SDK.
151-
// This is partially due to our setting ObjCRuntime.MarshalManagedExceptionMode.UnwindNativeCode above.
152151
nativeOptions.BeforeSend = evt =>
153152
{
154153
// There should only be one exception on the event in this case
@@ -164,6 +163,7 @@ private static void InitSentryCocoaSdk(SentryOptions options)
164163
ex.Stacktrace?.Frames.Any(f => f.Function == "xamarin_unhandled_exception_handler") is true)
165164
{
166165
// Don't send it
166+
options.LogDebug("Discarded {0} error ({1}). Captured as managed exception instead.", ex.Type, ex.Value);
167167
return null!;
168168
}
169169

@@ -173,6 +173,7 @@ private static void InitSentryCocoaSdk(SentryOptions options)
173173
if (ex.Type == "EXC_BAD_ACCESS")
174174
{
175175
// Don't send it
176+
options.LogDebug("Discarded {0} error ({1}). Captured as managed exception instead.", ex.Type, ex.Value);
176177
return null!;
177178
}
178179
}

test/Sentry.Tests/Platforms/iOS/RuntimeMarshalManagedExceptionIntegrationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# if IOS
1+
#if IOS
22
using ObjCRuntime;
33
using Sentry.Cocoa;
44

0 commit comments

Comments
 (0)