You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
126 lines
3.5 KiB
126 lines
3.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CoreAgent.ProtocolClient.Context.UeStateManager
|
|
{
|
|
/// <summary>
|
|
/// UeIdentifierManager 相关异常基类
|
|
/// </summary>
|
|
public abstract class UeIdentifierManagerException : Exception
|
|
{
|
|
protected UeIdentifierManagerException(string message) : base(message) { }
|
|
protected UeIdentifierManagerException(string message, Exception innerException) : base(message, innerException) { }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 标识符格式异常
|
|
/// </summary>
|
|
public class IdentifierFormatException : UeIdentifierManagerException
|
|
{
|
|
public string Identifier { get; }
|
|
public string ExpectedFormat { get; }
|
|
|
|
public IdentifierFormatException(string identifier, string expectedFormat, string message = null)
|
|
: base(message ?? $"标识符 '{identifier}' 格式无效,期望格式: {expectedFormat}")
|
|
{
|
|
Identifier = identifier;
|
|
ExpectedFormat = expectedFormat;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// UE信息异常
|
|
/// </summary>
|
|
public class UeInfoException : UeIdentifierManagerException
|
|
{
|
|
public int UeId { get; }
|
|
|
|
public UeInfoException(int ueId, string message)
|
|
: base(message)
|
|
{
|
|
UeId = ueId;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 映射关系异常
|
|
/// </summary>
|
|
public class MappingException : UeIdentifierManagerException
|
|
{
|
|
public string MappingType { get; }
|
|
public object Key { get; }
|
|
|
|
public MappingException(string mappingType, object key, string message)
|
|
: base(message)
|
|
{
|
|
MappingType = mappingType;
|
|
Key = key;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 缓存异常
|
|
/// </summary>
|
|
public class CacheException : UeIdentifierManagerException
|
|
{
|
|
public string CacheType { get; }
|
|
|
|
public CacheException(string cacheType, string message)
|
|
: base(message)
|
|
{
|
|
CacheType = cacheType;
|
|
}
|
|
|
|
public CacheException(string cacheType, string message, Exception innerException)
|
|
: base(message, innerException)
|
|
{
|
|
CacheType = cacheType;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 解析异常
|
|
/// </summary>
|
|
public class ParsingException : UeIdentifierManagerException
|
|
{
|
|
public string ParsingType { get; }
|
|
public string Input { get; }
|
|
|
|
public ParsingException(string parsingType, string input, string message)
|
|
: base(message)
|
|
{
|
|
ParsingType = parsingType;
|
|
Input = input;
|
|
}
|
|
|
|
public ParsingException(string parsingType, string input, string message, Exception innerException)
|
|
: base(message, innerException)
|
|
{
|
|
ParsingType = parsingType;
|
|
Input = input;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 通用UE标识符管理器异常
|
|
/// </summary>
|
|
public class GeneralUeIdentifierManagerException : UeIdentifierManagerException
|
|
{
|
|
public string Operation { get; }
|
|
|
|
public GeneralUeIdentifierManagerException(string operation, string message)
|
|
: base(message)
|
|
{
|
|
Operation = operation;
|
|
}
|
|
|
|
public GeneralUeIdentifierManagerException(string operation, string message, Exception innerException)
|
|
: base(message, innerException)
|
|
{
|
|
Operation = operation;
|
|
}
|
|
}
|
|
}
|
|
|