public MetricError(Metric metric, Exception exception, string messageFormat, params object[] args) { Time = DateTime.Now; try { Message = string.Format(CultureInfo.InvariantCulture, messageFormat, args); } catch { Message = string.Format(CultureInfo.InvariantCulture, "Error message: {0}", messageFormat); } Exception = exception; Metric = metric; } }