void ExecuteAndCheckErrorLog() { AS.XmlaResultCollection resultCol = Server.ExecuteCaptureLog(true, DoParallelProcessing, true); if (resultCol.ContainsErrors) { ErrorMessages += $"Errors occured in cube {ConnectionString.CatalogName}:" + Environment.NewLine; foreach (AS.XmlaResult result in resultCol) { foreach (object error in result.Messages) { if (error.GetType() == typeof(AS.XmlaError)) { ErrorMessages += "ERR: " + ((AS.XmlaError)error).Description + Environment.NewLine; } else if (error.GetType() == typeof(AS.XmlaWarning)) { ErrorMessages += "WARN: " + ((AS.XmlaWarning)error).Description + Environment.NewLine; } } } throw new Exception(ErrorMessages); } }
public static string GetMessageString(this AS.XmlaResultCollection xmlaResults) { return(string.Join(Environment.NewLine, xmlaResults.OfType <AS.XmlaResult>().SelectMany(r => r.Messages.OfType <AS.XmlaMessage>()).Select(msg => msg.Description).ToArray())); }