internal static XElement Meta(AggregateException exception, string eventName)
{
var meta = new XElement("Meta",
new XElement("Component", "Lokad.Cloud.Provisioning"),
new XElement("Event", eventName));
if (exception != null)
{
var ex = exception.GetBaseException();
meta.Add(new XElement("Exception",
new XAttribute("typeName", ex.GetType().FullName),
new XAttribute("message", ex.Message),
ex.ToString()));
}
return meta;
}