diff --git a/Engine.Core/Exceptions/AssignException.cs b/Engine.Core/Exceptions/AssignException.cs index 9adc27e..ec4f234 100644 --- a/Engine.Core/Exceptions/AssignException.cs +++ b/Engine.Core/Exceptions/AssignException.cs @@ -7,13 +7,6 @@ public class AssignException : Exception public AssignException() : base("Assign operation has failed.") { } public AssignException(string? message) : base(message) { } - // public static AssignException FromStateEnable(IStateEnable? stateEnable) - // => new AssignException($"{nameof(IGameObject.AssignStateEnable)} failed on type {stateEnable?.GetType().ToString() ?? "\"null\""}"); public static AssignException From(T to, T2? value) - => new($"Assign operation has failed on T: {typeof(T).FullName}, value: {value?.GetType().ToString() ?? "\"null\""}"); - // public static AssignException FromBehaviourController(IBehaviourController? behaviourController) - // => new AssignException($"{nameof(IGameObject.AssignBehaviourController)} failed on type {behaviourController?.GetType().ToString() ?? "\"null\""}"); + => new($"Assign operation has failed on T: {to?.GetType().FullName ?? "\"null\""}, value: {value?.GetType().ToString() ?? "\"null\""}"); } -// throw new Exception($"{nameof(IGameObject.AssignTransform)} failed on type {transform?.GetType().ToString() ?? "null"} for type {typeof(T).FullName}"); -// throw new Exception($"{nameof(IGameObject.AssignBehaviourController)} failed on type {behaviourController?.GetType().ToString() ?? "null"} for type {typeof(T).FullName}"); -// throw new Exception($"{nameof(IGameObject.AssignStateEnable)} failed on type {stateEnable?.GetType().ToString() ?? "null"} for type {typeof(T).FullName}"); diff --git a/Engine.Core/Exceptions/NotAssignedException.cs b/Engine.Core/Exceptions/NotAssignedException.cs index 8480fcf..51ac615 100644 --- a/Engine.Core/Exceptions/NotAssignedException.cs +++ b/Engine.Core/Exceptions/NotAssignedException.cs @@ -9,7 +9,7 @@ public class NotAssignedException : Exception public NotAssignedException(string? message) : base(message) { } public static NotAssignedException From(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 to, T2? value) where T1 : IAssignable {