Add RequiresDynamicCode attribute to exception formatter to indicate incompatability with AOT

This commit is contained in:
Phil Scott
2024-11-19 23:16:09 -05:00
committed by Patrik Svensson
parent 10773a5625
commit b67af32423
4 changed files with 12 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ public static class ExceptionExtensions
/// <param name="exception">The exception to format.</param>
/// <param name="format">The exception format options.</param>
/// <returns>A <see cref="IRenderable"/> representing the exception.</returns>
[RequiresDynamicCode(ExceptionFormatter.AotWarning)]
public static IRenderable GetRenderable(this Exception exception, ExceptionFormats format = ExceptionFormats.Default)
{
if (exception is null)
@@ -30,6 +31,7 @@ public static class ExceptionExtensions
/// <param name="exception">The exception to format.</param>
/// <param name="settings">The exception settings.</param>
/// <returns>A <see cref="IRenderable"/> representing the exception.</returns>
[RequiresDynamicCode(ExceptionFormatter.AotWarning)]
public static IRenderable GetRenderable(this Exception exception, ExceptionSettings settings)
{
if (exception is null)