static void Perform(Func<GenericReturn> action, bool async = false)
{
if (AppSettings.CollectUsageStats)
{
try
{
if (async)
{
Task.Run(action).ContinueWith(t => WriteError(t.Result));
}
else
{
var result = action();
WriteError(result);
}
}
// ReSharper disable EmptyGeneralCatchClause
catch
// ReSharper restore EmptyGeneralCatchClause
{
// this is a tracker issue ;(
}
}
}