Skip to content

Commit 14369d8

Browse files
CopilotJack251970
andcommitted
Address code review: add exception handling and move success message
Co-authored-by: Jack251970 <53996452+Jack251970@users.noreply.github.com>
1 parent 07294aa commit 14369d8

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

  • Plugins/Flow.Launcher.Plugin.Program

Plugins/Flow.Launcher.Plugin.Program/Main.cs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -444,14 +444,21 @@ public List<Result> LoadContextMenus(Result selectedResult)
444444
{
445445
_ = Task.Run(async () =>
446446
{
447-
await DisableProgramAsync(program);
448-
ResetCache();
449-
Context.API.ReQuery();
447+
try
448+
{
449+
await DisableProgramAsync(program);
450+
ResetCache();
451+
Context.API.ShowMsg(
452+
Context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_success"),
453+
Context.API.GetTranslation(
454+
"flowlauncher_plugin_program_disable_dlgtitle_success_message"));
455+
Context.API.ReQuery();
456+
}
457+
catch (Exception e)
458+
{
459+
Context.API.LogException(ClassName, "Failed to disable program", e);
460+
}
450461
});
451-
Context.API.ShowMsg(
452-
Context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_success"),
453-
Context.API.GetTranslation(
454-
"flowlauncher_plugin_program_disable_dlgtitle_success_message"));
455462
return false;
456463
},
457464
IcoPath = "Images/disable.png",

0 commit comments

Comments
 (0)