/// <summary> /// Create Instance of SdmxException /// </summary> /// <param name="Control">Object that fired Exception (this for all Object, typeof(ClassName) for staticFunction)</param> /// <param name="typeErr">Internal Exception type Enumerator</param> /// <param name="Ex">Additional Exception</param> public SdmxException(object Control, FlyExceptionObject.FlyExceptionTypeEnum typeErr, Exception Ex) { FlyLog.WriteLog(this, FlyLog.LogTypeEnum.Error, "Start Writing Error type {0} message {1}", typeErr.ToString(), Ex == null?"":Ex.Message); this.FlyException = FlyExceptionObject.Get(typeErr); //Fault this.SDMXFaultCode = this.FlyException.SDMXException._sdmxErrorCode; this.SDMXFaultMessage = this.FlyException.SDMXException._sdmxErrorText; //detail this.MessageText = string.Format("{0}", FlyException.FlyExceptionText); bool IsEmptyDetail = false; if (Ex == null) { IsEmptyDetail = true; Ex = new Exception(this.MessageText); } this.MessageError = new FlyMessageError(Ex, IsEmptyDetail); try { if (Control is string) { this.ProcSource = Control as string; } else if (Control is Type) { this.ProcSource = (Control as Type).FullName; } else { this.ProcSource = Control.GetType().FullName; } } catch (Exception) { this.ProcSource = Ex.Source; } }
/// <summary> /// Create Instance of SdmxException /// </summary> /// <param name="Control">Object that fired Exception (this for all Object, typeof(ClassName) for staticFunction)</param> /// <param name="typeErr">Internal Exception type Enumerator</param> public SdmxException(object Control, FlyExceptionObject.FlyExceptionTypeEnum typeErr) : this(Control, typeErr, null) { }