Camera Information System
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.

54 lines
1.3 KiB

namespace EC.Helper.CameraSDK;
/// <summary>
/// 相机异常
/// </summary>
public class CameraException : Exception
{
public CameraException() : base()
{
}
public CameraException(string? message) : base(message)
{
}
public CameraException(string? message, Exception? innerException) : base(message, innerException)
{
}
protected class CameraExceptionObj
{
public CameraManufactor Manufactor { get; set; }
public int ErrCode { get; set; }
public string? ErrMsg { get; set; }
public override string? ToString()
{
return $"Manufactor:{Manufactor}, ErrCode:{ErrCode}, ErrMsg:{ErrMsg}";
}
}
public static CameraException New(CameraManufactor manufactor, int errCode)
{
CameraExceptionObj obj = new()
{
Manufactor = manufactor,
ErrCode = errCode
};
return new CameraException(obj.ToString());
}
public static CameraException New(CameraManufactor manufactor, int errCode, string errMsg)
{
CameraExceptionObj obj = new()
{
Manufactor = manufactor,
ErrCode = errCode,
ErrMsg = errMsg
};
return new CameraException(obj.ToString());
}
}