Files
BITKit/Src/Core/Net/Exception.cs

32 lines
1.2 KiB
C#
Raw Normal View History

2024-11-03 16:38:17 +08:00
namespace BITKit
{
2025-07-11 11:45:45 +08:00
public class NetRemoteInternalException : System.Exception
{
public NetRemoteInternalException() : base("Remote internal error") { }
public NetRemoteInternalException(string message) : base(message) { }
public NetRemoteInternalException(string message, System.Exception innerException) : base(message, innerException) { }
}
2024-11-03 16:38:17 +08:00
public class NetOfflineException : System.Exception
{
public NetOfflineException() : base("Client is not connected") { }
}
public class NetAuthorizeException : System.Exception
{
public NetAuthorizeException() : base("Client is not authorized") { }
}
public abstract class NetAuthorityException : System.Exception
{
protected NetAuthorityException(string message =null) : base(string.IsNullOrEmpty(message)?"Authority is not valid":message) { }
}
public class NetClientOnlyException : NetAuthorityException
{
public NetClientOnlyException() : base("This method is only available on client") { }
}
public class NetServerOnlyException : NetAuthorityException
{
public NetServerOnlyException() : base("This method is only available on server") { }
}
2025-07-11 11:45:45 +08:00
2024-11-03 16:38:17 +08:00
}