diff --git a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.UnitConverter/Main.cs b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.UnitConverter/Main.cs index bc4c00d7a7..727f6fbf83 100644 --- a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.UnitConverter/Main.cs +++ b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.UnitConverter/Main.cs @@ -14,6 +14,7 @@ using System.Windows.Input; using ManagedCommon; using Wox.Plugin; +using Wox.Plugin.Logger; namespace Community.PowerToys.Run.Plugin.UnitConverter { @@ -75,9 +76,10 @@ namespace Community.PowerToys.Run.Plugin.UnitConverter Clipboard.SetText(result.ConvertedValue.ToString(UnitConversionResult.CopyFormat, CultureInfo.CurrentCulture)); ret = true; } - catch (ExternalException) + catch (ExternalException ex) { - MessageBox.Show(Properties.Resources.copy_failed); + Log.Exception("Copy failed", ex, GetType()); + MessageBox.Show(ex.Message, Properties.Resources.copy_failed); } }); thread.SetApartmentState(ApartmentState.STA); @@ -107,9 +109,10 @@ namespace Community.PowerToys.Run.Plugin.UnitConverter Clipboard.SetText(result.ConvertedValue.ToString(UnitConversionResult.CopyFormat, CultureInfo.CurrentCulture)); ret = true; } - catch (ExternalException) + catch (ExternalException ex) { - MessageBox.Show(Properties.Resources.copy_failed); + Log.Exception("Copy failed", ex, GetType()); + MessageBox.Show(ex.Message, Properties.Resources.copy_failed); } }); thread.SetApartmentState(ApartmentState.STA); diff --git a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.ValueGenerator/Main.cs b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.ValueGenerator/Main.cs index 494229a456..72f390a4a5 100644 --- a/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.ValueGenerator/Main.cs +++ b/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.ValueGenerator/Main.cs @@ -184,9 +184,10 @@ namespace Community.PowerToys.Run.Plugin.ValueGenerator Clipboard.SetText(request.ResultToString()); ret = true; } - catch (ExternalException) + catch (ExternalException ex) { - MessageBox.Show(Properties.Resources.copy_failed); + Log.Exception("Copy failed", ex, GetType()); + MessageBox.Show(ex.Message, Properties.Resources.copy_failed); } }); thread.SetApartmentState(ApartmentState.STA); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/ResultHelper.cs index cfeabd0f92..9b32a6f1e3 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/ResultHelper.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Windows; using Wox.Plugin; +using Wox.Plugin.Logger; namespace Microsoft.PowerToys.Run.Plugin.Calculator { @@ -51,9 +52,10 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator Clipboard.SetText(roundedResult?.ToString(culture)); ret = true; } - catch (ExternalException) + catch (ExternalException ex) { - MessageBox.Show(Properties.Resources.wox_plugin_calculator_copy_failed); + Log.Exception("Copy failed", ex, typeof(ResultHelper)); + MessageBox.Show(ex.Message, Properties.Resources.wox_plugin_calculator_copy_failed); } }); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/ResultHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/ResultHelper.cs index 5809fefa5d..7ea0ed798c 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/ResultHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/ResultHelper.cs @@ -50,13 +50,13 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.Components { try { - Clipboard.Clear(); Clipboard.SetText(text); return true; } catch (Exception exception) { Log.Exception("Can't copy to clipboard", exception, typeof(ResultHelper)); + MessageBox.Show(exception.Message, Resources.Microsoft_plugin_timedate_copy_failed); return false; } } diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Properties/Resources.Designer.cs index da32b13a6d..1ecd40721d 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Properties/Resources.Designer.cs @@ -60,6 +60,15 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.Properties { } } + /// + /// Looks up a localized string similar to Copy failed. + /// + internal static string Microsoft_plugin_timedate_copy_failed { + get { + return ResourceManager.GetString("Microsoft_plugin_timedate_copy_failed", resourceCulture); + } + } + /// /// Looks up a localized string similar to Copy value (Ctrl+C). /// diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Properties/Resources.resx index 3cc62b0bbd..de7f2a0be5 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Properties/Resources.resx @@ -121,6 +121,9 @@ Copy value (Ctrl+C) 'Ctrl+C' is a shortcut + + Copy failed + Date