From e4ce6c2cfd03cd360839568869fafad8c555278d Mon Sep 17 00:00:00 2001 From: Ricky White Date: Tue, 11 Jun 2024 09:54:12 -0400 Subject: [PATCH 1/2] Fix unhandled exceptions --- Keeper.WindowsCredentialManager/Program.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Keeper.WindowsCredentialManager/Program.cs b/Keeper.WindowsCredentialManager/Program.cs index 3563953..f7e1ffa 100644 --- a/Keeper.WindowsCredentialManager/Program.cs +++ b/Keeper.WindowsCredentialManager/Program.cs @@ -35,9 +35,18 @@ public static async Task Main(string[] args) setCommand.AddArgument(configArg); setCommand.SetHandler((appName, configArg) => { - CredentialManager.WriteCredential(appName, Environment.UserName, Parsing.ParseConfig(configArg)); - // Exit with success code - Environment.Exit(0); + try + { + var secret = Parsing.ParseConfig(configArg); + CredentialManager.WriteCredential(appName, Environment.UserName, secret); + // Exit with success code + Environment.Exit(0); + } + catch (ArgumentException e) + { + Console.Error.WriteLine(e.Message); + Environment.Exit(1); + } }, appName, configArg); getCommand.AddArgument(appName); @@ -47,7 +56,7 @@ public static async Task Main(string[] args) // Output cred to stdout and exit with success code if (cred == null) { - Console.WriteLine("No KSM Config found for the given application name."); + Console.Error.WriteLine("No KSM Config found for the given application name."); Environment.Exit(1); } Console.WriteLine(cred.Password); From 39148f50c0f9925ba76c3060c423794b2dfe31e4 Mon Sep 17 00:00:00 2001 From: Ricky White Date: Tue, 11 Jun 2024 10:02:52 -0400 Subject: [PATCH 2/2] Fix typo in the bug report template --- .github/ISSUE_TEMPLATE/BUG_REPORT_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT_TEMPLATE.md b/.github/ISSUE_TEMPLATE/BUG_REPORT_TEMPLATE.md index 648e926..9194a0c 100644 --- a/.github/ISSUE_TEMPLATE/BUG_REPORT_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT_TEMPLATE.md @@ -17,7 +17,7 @@ Tell us what _actually_ happens **Your environment** -Tell us more about your environment; such as, What OS are you running? What version of `git-ssh-sign` are you using? Etc. +Tell us more about your environment; such as, What OS are you running? What version of the binary are you using? Etc. **Steps to reproduce**