/// <summary> /// Add a fatal error to treament with http code /// </summary> /// <param name="httpcode"></param> /// <param name="message"></param> public void AddFatalErrorWithCode(HttpStatusCode httpcode, string message = null) { var tre = new TreatmentEvent(MessagesType.FatalError, httpcode, message); StatusCode = httpcode; FatalErrors.Add(tre); }
/// <summary> /// return a new Treatment, fusion of both treatment /// </summary> /// <param name="???"></param> /// <returns></returns> public Treatment Merge(Treatment tr) { var newTr = new Treatment(); //merge fatal errors newTr.FatalErrors = FatalErrors.Union(tr.FatalErrors).ToList(); // Merge errors newTr.Errors = this.Errors.Union(tr.Errors).ToList(); // Merge Warnings newTr.Warnings = Warnings.Union(tr.Warnings).ToList(); // Merge info newTr.Info = Info.Union(tr.Info).ToList(); // Merge Objects newTr.Objects = Objects.Union(tr.Objects).ToList(); // newTr.Objects = Treatment.MergeObjects(Objects, tr.Objects); return(newTr); }
/// <summary> /// Chack if no fatal errors /// </summary> /// <returns></returns> public bool HasFatalErrors() { return(FatalErrors.Any()); }
/// <summary> /// Check if no errors or no fatal errors /// </summary> /// <returns></returns> public bool IsSuccess() { return(!FatalErrors.Any() && !Errors.Any()); }
public void AddFatalError(string message) { FatalErrors.Add(new TreatmentEvent(MessagesType.FatalError, message)); }
} // Get private void AddFatalError(string sError) { FatalErrors.Add(sError); this.log.Debug(sError); } // AddFatalError