public void Log(string message, Action function) { try { function(); } catch (Exception ex) { _errors.Add($"{message}\n{ex.ToString()}"); } }