Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
comments
  • Loading branch information
Yun-Ting committed Feb 29, 2024
commit 2708affe2653c55e60e86402602517cd03fd1625
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class TracerProviderBuilderExtensions
/// <param name="enabled">Enabled or not. Default value is <c>true</c>.</param>
/// <returns>Returns <see cref="TracerProviderBuilder"/> for chaining.</returns>
#if NET7_0_OR_GREATER
[RequiresDynamicCode("Calling this method will invoke Marshal.GetExceptionPointers(), which is neither supported in MonoRuntime nor in nativeAOT environment.")]
[RequiresDynamicCode("SetErrorStatusOnException is neither supported in MonoRuntime nor in nativeAOT environment.")]
#endif
public static TracerProviderBuilder SetErrorStatusOnException(this TracerProviderBuilder tracerProviderBuilder, bool enabled = true)
{
Expand Down
4 changes: 2 additions & 2 deletions src/OpenTelemetry/Trace/ExceptionProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ public ExceptionProcessor()
{
Marshal.GetExceptionPointers();
}
catch
catch (PlatformNotSupportedException)
{
getExceptionPointersSupported = false;
}

if (!getExceptionPointersSupported)
{
throw new PlatformNotSupportedException($"'{typeof(Marshal).FullName}.GetExceptionPointers' is not supported.");
throw new PlatformNotSupportedException("The SetErrorStatusOnException extension method is not supported on this platform.");
}

this.fnGetExceptionPointers = Marshal.GetExceptionPointers;
Expand Down