private static void CallWithErrorMessage(IServiceProvider serviceProvider, Action action) { try { action(); } catch (Exception ex) { if (Microsoft.VisualStudio.ErrorHandler.IsCriticalException(ex)) { throw; } ShowErrorMessage(serviceProvider, ex); } }