예제 #1
0
            public override void HandleException(object provider, Exception exception)
            {
                if (provider is CodeFixProvider or FixAllProvider or CodeRefactoringProvider)
                {
                    if (!IsIgnored(provider) &&
                        _globalOptions.GetOption(ExtensionManagerOptions.DisableCrashingExtensions))
                    {
                        base.HandleException(provider, exception);

                        _errorReportingService?.ShowGlobalErrorInfo(string.Format(WorkspacesResources._0_encountered_an_error_and_has_been_disabled, provider.GetType().Name),
                                                                    exception,
                                                                    new InfoBarUI(WorkspacesResources.Show_Stack_Trace, InfoBarUI.UIKind.HyperLink, () => ShowDetailedErrorInfo(exception), closeAfterAction: false),
                                                                    new InfoBarUI(WorkspacesResources.Enable, InfoBarUI.UIKind.Button, () =>
                        {
                            EnableProvider(provider);
                            LogEnableProvider(provider);
                        }),
                                                                    new InfoBarUI(WorkspacesResources.Enable_and_ignore_future_errors, InfoBarUI.UIKind.Button, () =>
                        {
                            EnableProvider(provider);
                            IgnoreProvider(provider);
                            LogEnableAndIgnoreProvider(provider);
                        }),
                                                                    new InfoBarUI(String.Empty, InfoBarUI.UIKind.Close, () => LogLeaveDisabled(provider)));
                    }
                    else
                    {
                        LogAction(CodefixInfobar_ErrorIgnored, provider);
                    }
                }