diff options
| author | JP Dillingham <jp@dillingham.me> | 2023-01-07 19:06:47 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2023-01-07 19:06:47 -0600 |
| commit | 94be479de298fd23628d0b9bcfb424f552be5ea1 (patch) | |
| tree | bacd4884572739a0d18ff51ea6070e5ea4c5fbc7 | |
| parent | ff5f0ac6c93f2b49ba259e7093fb92fa873116c6 (diff) | |
| download | slskd-94be479de298fd23628d0b9bcfb424f552be5ea1.tar.gz | |
fail more gracefully on bad input
| -rw-r--r-- | src/slskd/Program.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 28ef7279..183f8426 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -243,7 +243,17 @@ namespace slskd // populate the properties above so that we can override the default config file if needed, and to // check if the application is being run in command mode (run task and quit). EnvironmentVariables.Populate(prefix: EnvironmentVariablePrefix); + + try + { Arguments.Populate(clearExistingValues: false); + } + catch (Exception ex) + { + // this is pretty hacky, but i don't have a good way of trapping errors that bubble up here. + Log.Error($"Invalid command line input: {ex.Message.Replace(". See inner exception for details.", string.Empty)}"); + return; + } // if a user has used one of the arguments above, perform the requested task, then quit if (ShowVersion) |
