[PTRun][Program]Add logs on launch failure (#17270)

This commit is contained in:
Jaime Bernardo 2022-03-25 15:30:06 +00:00 committed by GitHub
parent 1be880438a
commit 403969587e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -185,8 +185,9 @@ namespace Microsoft.Plugin.Program
runProcess(info);
}
catch (Exception)
catch (Exception ex)
{
Logger.ProgramLogger.Exception($"Unable to start ", ex, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, info?.FileName);
var name = "Plugin: " + Properties.Resources.wox_plugin_program_plugin_name;
var message = $"{Properties.Resources.powertoys_run_plugin_program_start_failed}: {info?.FileName}";
_context.API.ShowMsg(name, message, string.Empty);

View File

@ -214,8 +214,9 @@ namespace Microsoft.Plugin.Program.Programs
{
appManager.ActivateApplication(UserModelId, queryArguments, noFlags, out var unusedPid);
}
catch (Exception)
catch (Exception ex)
{
ProgramLogger.Exception($"Unable to launch UWP {DisplayName}", ex, MethodBase.GetCurrentMethod().DeclaringType, queryArguments);
var name = "Plugin: " + Properties.Resources.wox_plugin_program_plugin_name;
var message = $"{Properties.Resources.powertoys_run_plugin_program_uwp_failed}: {DisplayName}";
api.ShowMsg(name, message, string.Empty);