private async Task PlainTextAndCopy() { string html = this.SourceValue; string text; #pragma warning disable CA1031 // Do not catch general exception types try { text = TextCleaner.HtmlToPlainText(html); } catch (Exception ex) { Logger.Log(LogLevel.Error, nameof(PlainTextAndCopy), "Error cleaning HTML to text:" + Environment.NewLine + html, ex); MessageBox.Show("There was an error getting text from the HTML", "error", MessageBoxButton.OK, MessageBoxImage.Error); return; } try { ClipboardHelper.CopyPlainTextToClipboard(text); } catch (Exception ex) { Logger.Log(LogLevel.Error, nameof(PlainTextAndCopy), "Error writing TEXT to clipboard", ex); MessageBox.Show("There was an error writing the TEXT to the clipboard", "error", MessageBoxButton.OK, MessageBoxImage.Error); return; } #pragma warning restore CA1031 // Do not catch general exception types this.SourceValue = text; await this.SetStatus("The plain TEXT is on the clipboard, use Ctrl-V to paste.").ConfigureAwait(false); }