chore: improved exception messages

This commit is contained in:
2025-03-17 21:38:26 +03:00
parent 9af44d48b3
commit 62b43025b9
2 changed files with 2 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ public class NotAssignedException : Exception
public NotAssignedException(string? message) : base(message) { }
public static NotAssignedException From<T1, T2>(T1 to, T2? value) where T1 : IAssignable
=> new($"{typeof(T2).Name} has not been assigned to {typeof(T1).Name}");
=> new($"{value?.GetType().FullName ?? "\"null\""} has not been assigned to {to?.GetType().FullName ?? "\"null\""}");
public static void Check<T1, T2>(T1 to, T2? value) where T1 : IAssignable
{