DragonECS-Graphs/src/Utils/Exceptions.cs

43 lines
1.3 KiB
C#
Raw Normal View History

2023-06-22 03:54:20 +08:00
using System;
2024-01-26 21:56:03 +08:00
using System.Runtime.CompilerServices;
2023-06-22 03:54:20 +08:00
using System.Runtime.Serialization;
2024-01-26 21:56:03 +08:00
namespace DCFApixels.DragonECS.Relations.Internal
{
internal static class Throw
{
[MethodImpl(MethodImplOptions.NoInlining)]
internal static void ArgumentNull()
{
throw new ArgumentNullException();
}
2024-01-31 04:25:48 +08:00
[MethodImpl(MethodImplOptions.NoInlining)]
internal static void UndefinedException()
{
throw new Exception();
}
[MethodImpl(MethodImplOptions.NoInlining)]
internal static void ArgumentOutOfRange()
{
throw new ArgumentOutOfRangeException();
}
[MethodImpl(MethodImplOptions.NoInlining)]
internal static void UndefinedRelationException()
{
throw new EcsRelationException();
}
2024-01-26 21:56:03 +08:00
}
}
2023-06-22 03:54:20 +08:00
namespace DCFApixels.DragonECS
{
[Serializable]
public class EcsRelationException : Exception
{
public EcsRelationException() { }
public EcsRelationException(string message) : base(EcsConsts.EXCEPTION_MESSAGE_PREFIX + message) { }
public EcsRelationException(string message, Exception inner) : base(EcsConsts.EXCEPTION_MESSAGE_PREFIX + message, inner) { }
protected EcsRelationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}