/// <summary> /// Is there an execution error that we have tracked in our execution log. We also /// consider abandonment as a form of error. /// </summary> /// <returns>true if there is at least one execution error, false otherwise</returns> public bool HasExecuteError() { lock (ExecuteLogSync) { // If we have nothing in the execution log, there can't be an error. if (ExecuteLog == null || ExecuteLog.Count == 0) { return(false); } return(ExecuteLog.Any( x => x.Value.Abandoned || x.Value.Response.Any(y => y.HasError()))); } }
/// <summary> /// Return a formatted string containing all of the error messages /// </summary> /// <returns></returns> public List <string> GetExecuteErrors() { lock (ExecuteLogSync) { // If we have nothing in the execution log, there can't be an error. if (ExecuteLog == null || ExecuteLog.Count == 0) { return(null); } var errors = ExecuteLog.SelectMany(x => x.Value.Response.Select(y => y.GetError())) .Where(x => !string.IsNullOrWhiteSpace(x)) .ToList(); if (ExecuteLog.Any(x => x.Value.Abandoned)) { errors.Add(ABANDONED_CODE_ERROR_MESSAGE); } return(errors); } }