Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
System.InvalidOperationException: Something threw!
System.InvalidOperationException: Throwing!
at bool Spectre.Console.Tests.Data.TestExceptions.GenericMethodThatThrows<T0,T1,TRet>(int? number) in /xyz/Exceptions.cs:nn
at void Spectre.Console.Tests.Data.TestExceptions.ThrowWithGenericInnerException() in /xyz/Exceptions.cs:nn
at void Spectre.Console.Tests.Data.TestExceptions.ThrowWithGenericInnerException() in /xyz/Exceptions.cs:nn
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exceptions_With_Generic_Type_Parameters_In_Callsite_As_Expected>b__4_0() in /xyz/ExceptionTests.cs:nn
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:nn
System.InvalidOperationException: Something threw!
System.InvalidOperationException: Throwing!
at bool Spectre.Console.Tests.Data.TestExceptions.GenericMethodThatThrows<T0,T1,TRet>(int? number) in /xyz/Exceptions.cs:100
at void Spectre.Console.Tests.Data.TestExceptions.ThrowWithGenericInnerException() in /xyz/Exceptions.cs:200
at void Spectre.Console.Tests.Data.TestExceptions.ThrowWithGenericInnerException() in /xyz/Exceptions.cs:300
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exceptions_With_Generic_Type_Parameters_In_Callsite_As_Expected>b__4_0() in /xyz/ExceptionTests.cs:400
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:500
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
System.InvalidOperationException: Throwing!
at bool Spectre.Console.Tests.Data.TestExceptions.MethodThatThrows(int? number) in /xyz/Exceptions.cs:nn
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exception>b__0_0() in /xyz/ExceptionTests.cs:nn
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:nn
at bool Spectre.Console.Tests.Data.TestExceptions.MethodThatThrows(int? number) in /xyz/Exceptions.cs:100
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exception>b__0_0() in /xyz/ExceptionTests.cs:200
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:300
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ GenericException<IAnsiConsole>: Throwing! │
│ at bool MethodThatThrowsGenericException<T>() in Exceptions.cs:100 │
│ at void <Exception_Within_Expanded_Panel_Should_Expand_As_Expected>b__10_0() in ExceptionTests.cs:200 │
│ at Exception GetException(Action action) in ExceptionTests.cs:300 │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Spectre.Console.Tests.Data.GenericException<Spectre.Console.IAnsiConsole>: Throwing!
at bool Spectre.Console.Tests.Data.TestExceptions.MethodThatThrowsGenericException<T>() in /xyz/Exceptions.cs:nn
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_GenericException>b__8_0() in /xyz/ExceptionTests.cs:nn
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:nn
at bool Spectre.Console.Tests.Data.TestExceptions.MethodThatThrowsGenericException<T>() in /xyz/Exceptions.cs:100
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_GenericException>b__8_0() in /xyz/ExceptionTests.cs:200
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:300
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GenericException<IAnsiConsole>: Throwing!
at bool MethodThatThrowsGenericException<T>() in /xyz/ in Exceptions.cs:nn
at void <Should_Write_GenericException>b__8_0() in /xyz/ in ExceptionTests.cs:nn
at Exception GetException(Action action) in /xyz/ in ExceptionTests.cs:nn
at bool MethodThatThrowsGenericException<T>() in Exceptions.cs:100
at void <Should_Write_GenericException>b__8_0() in ExceptionTests.cs:200
at Exception GetException(Action action) in ExceptionTests.cs:300
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Spectre.Console.Tests.Data.GenericException<Spectre.Console.IAnsiConsole>: Throwing!
at bool MethodThatThrowsGenericException<T>() in /xyz/Exceptions.cs:nn
at void <Should_Write_GenericException>b__8_0() in /xyz/ExceptionTests.cs:nn
at Exception GetException(Action action) in /xyz/ExceptionTests.cs:nn
at bool MethodThatThrowsGenericException<T>() in /xyz/Exceptions.cs:100
at void <Should_Write_GenericException>b__8_0() in /xyz/ExceptionTests.cs:200
at Exception GetException(Action action) in /xyz/ExceptionTests.cs:300
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GenericException<IAnsiConsole>: Throwing!
at bool Spectre.Console.Tests.Data.TestExceptions.MethodThatThrowsGenericException<T>() in /xyz/Exceptions.cs:nn
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_GenericException>b__8_0() in /xyz/ExceptionTests.cs:nn
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:nn
at bool Spectre.Console.Tests.Data.TestExceptions.MethodThatThrowsGenericException<T>() in /xyz/Exceptions.cs:100
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_GenericException>b__8_0() in /xyz/ExceptionTests.cs:200
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:300
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
System.InvalidOperationException: Something threw!
System.InvalidOperationException: Throwing!
at bool Spectre.Console.Tests.Data.TestExceptions.MethodThatThrows(int? number) in /xyz/Exceptions.cs:nn
at void Spectre.Console.Tests.Data.TestExceptions.ThrowWithInnerException() in /xyz/Exceptions.cs:nn
at void Spectre.Console.Tests.Data.TestExceptions.ThrowWithInnerException() in /xyz/Exceptions.cs:nn
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exception_With_Inner_Exception>b__3_0() in /xyz/ExceptionTests.cs:nn
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:nn
System.InvalidOperationException: Something threw!
System.InvalidOperationException: Throwing!
at bool Spectre.Console.Tests.Data.TestExceptions.MethodThatThrows(int? number) in /xyz/Exceptions.cs:100
at void Spectre.Console.Tests.Data.TestExceptions.ThrowWithInnerException() in /xyz/Exceptions.cs:200
at void Spectre.Console.Tests.Data.TestExceptions.ThrowWithInnerException() in /xyz/Exceptions.cs:300
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exception_With_Inner_Exception>b__3_0() in /xyz/ExceptionTests.cs:400
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:500
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ GenericException<IAnsiConsole>: Throwing! │
│ at bool MethodThatThrowsGenericException<T>() in Exceptions.cs:100 │
│ at void <Should_Take_Up_Minimum_Space_When_Wrapped>b__9_0() in ExceptionTests.cs:200 │
│ at Exception GetException(Action action) in ExceptionTests.cs:300 │
└────────────────────────────────────────────────────────────────────────────────────────┘
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
InvalidOperationException: Throwing!
at List<T> Spectre.Console.Tests.Data.TestExceptions.GenericMethodWithOutThatThrows<T>(out List<T> firstFewItems) in /xyz/Exceptions.cs:nn
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exception_With_Output_Param>b__5_0() in /xyz/ExceptionTests.cs:nn
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:nn
at List<T> Spectre.Console.Tests.Data.TestExceptions.GenericMethodWithOutThatThrows<T>(out List<T> firstFewItems) in /xyz/Exceptions.cs:100
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exception_With_Output_Param>b__5_0() in /xyz/ExceptionTests.cs:200
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:300
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
System.InvalidOperationException: Throwing!
at bool MethodThatThrows(int? number) in /xyz/Exceptions.cs:nn
at void <Should_Write_Exception_With_Shortened_Methods>b__2_0() in /xyz/ExceptionTests.cs:nn
at Exception GetException(Action action) in /xyz/ExceptionTests.cs:nn
at bool MethodThatThrows(int? number) in /xyz/Exceptions.cs:100
at void <Should_Write_Exception_With_Shortened_Methods>b__2_0() in /xyz/ExceptionTests.cs:200
at Exception GetException(Action action) in /xyz/ExceptionTests.cs:300
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
InvalidOperationException: Throwing!
at bool Spectre.Console.Tests.Data.TestExceptions.MethodThatThrows(int? number) in /xyz/Exceptions.cs:nn
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exception_With_Shortened_Types>b__1_0() in /xyz/ExceptionTests.cs:nn
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:nn
at bool Spectre.Console.Tests.Data.TestExceptions.MethodThatThrows(int? number) in /xyz/Exceptions.cs:100
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exception_With_Shortened_Types>b__1_0() in /xyz/ExceptionTests.cs:200
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:300
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
InvalidOperationException: Throwing!
at bool Spectre.Console.Tests.Data.TestExceptions.MethodThatThrows(int? number) in /xyz/Exceptions.cs:nn
at (string Key, List<T> Values) Spectre.Console.Tests.Data.TestExceptions.GetTuplesWithInnerException<T>((int First, string Second) myValue) in /xyz/Exceptions.cs:nn
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exception_With_Tuple_Return>b__6_0() in /xyz/ExceptionTests.cs:nn
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:nn
InvalidOperationException: Throwing!
at bool Spectre.Console.Tests.Data.TestExceptions.MethodThatThrows(int? number) in /xyz/Exceptions.cs:100
at (string Key, List<T> Values) Spectre.Console.Tests.Data.TestExceptions.GetTuplesWithInnerException<T>((int First, string Second) myValue) in /xyz/Exceptions.cs:200
at void Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exception_With_Tuple_Return>b__6_0() in /xyz/ExceptionTests.cs:300
at Exception Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:400
Original file line number Diff line number Diff line change
Expand Up @@ -1897,11 +1897,24 @@
ShortenEverything = 7,
NoStackTrace = 16,
}
[System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode")]
[System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2070:RequiresUnreferencedCode")]
[System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2075:RequiresUnreferencedCode")]
[System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL3050:RequiresUnreferencedCode")]
public class ExceptionInfoResolver
{
public ExceptionInfoResolver() { }
public virtual int GetFileLineNumber(System.Diagnostics.StackFrame frame) { }
public virtual string? GetFileName(System.Diagnostics.StackFrame frame) { }
public virtual string GetMethodName(System.Reflection.MethodBase method) { }
public virtual string GetParameterName(System.Reflection.ParameterInfo parameter) { }
}
public sealed class ExceptionSettings
{
public ExceptionSettings() { }
public Spectre.Console.ExceptionFormats Format { get; set; }
public Spectre.Console.ExceptionStyle Style { get; set; }
public Spectre.Console.ExceptionFormats Format { get; init; }
public Spectre.Console.ExceptionInfoResolver Resolver { get; init; }
public Spectre.Console.ExceptionStyle Style { get; init; }
}
public sealed class ExceptionStyle
{
Expand Down
Loading