File tree Expand file tree Collapse file tree
src/Sentry/Platforms/Native Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -396,9 +396,9 @@ internal struct sentry_value_t
396396 [ UnmanagedCallersOnly ]
397397 private static void nativeTransport ( IntPtr envelope , IntPtr state )
398398 {
399+ var options = GCHandle . FromIntPtr ( state ) . Target as SentryOptions ;
399400 try
400401 {
401- var options = GCHandle . FromIntPtr ( state ) . Target as SentryOptions ;
402402 if ( options is not null )
403403 {
404404 var data = sentry_envelope_serialize ( envelope , out var size ) ;
@@ -409,9 +409,10 @@ private static void nativeTransport(IntPtr envelope, IntPtr state)
409409 client . SendAsync ( request ) . GetAwaiter ( ) . GetResult ( ) ;
410410 }
411411 }
412- catch
412+ catch ( Exception e )
413413 {
414414 // never allow an exception back to native code - it would crash the app
415+ options ? . DiagnosticLogger ? . LogError ( e , "Exception in native transport callback. The native envelope will not be sent." ) ;
415416 }
416417 finally
417418 {
You can’t perform that action at this time.
0 commit comments