namespace EC.Helper.CameraSDK; /// /// 相机异常 /// 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()); } }