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 CameraType Type { get; set; } public int ErrCode { get; set; } public string? ErrMsg { get; set; } public override string? ToString() { return $"Type:{Type}, ErrCode:{ErrCode}, ErrMsg:{ErrMsg}"; } } public static CameraException New(CameraType type, int errCode) { CameraExceptionObj obj = new() { Type = type, ErrCode = errCode }; return new CameraException(obj.ToString()); } public static CameraException New(CameraType type, int errCode, string errMsg) { CameraExceptionObj obj = new() { Type = type, ErrCode = errCode, ErrMsg = errMsg }; return new CameraException(obj.ToString()); } }