diff options
| author | JP Dillingham <jp@dillingham.me> | 2024-04-28 18:02:15 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2024-04-28 18:02:15 -0500 |
| commit | 0f79d9f8fd07690e5e3757c1be6f23e1c205dd86 (patch) | |
| tree | f339ea5ec10d60a725d088ff2ac84aad12328618 /src | |
| parent | 28372896b8dae9fd20b48a2a6bc8e077e91e18ea (diff) | |
| download | slskd-0f79d9f8fd07690e5e3757c1be6f23e1c205dd86.tar.gz | |
make validation work
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Core/Blacklist.cs | 2 | ||||
| -rw-r--r-- | src/slskd/Core/Options.cs | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/slskd/Core/Blacklist.cs b/src/slskd/Core/Blacklist.cs index 56414ad6..76f0b37f 100644 --- a/src/slskd/Core/Blacklist.cs +++ b/src/slskd/Core/Blacklist.cs @@ -151,7 +151,7 @@ public class Blacklist } } - throw new FormatException($"Failed to detect blacklist format. Only CIDR, P2P and DAT formats are supported"); + throw new FormatException("Failed to detect blacklist format. Only CIDR, P2P and DAT formats are supported"); } /// <summary> diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index 0ede272d..81dc09f6 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -1148,11 +1148,12 @@ namespace slskd // kill the application try { - _ = slskd.Blacklist.DetectFormat(File); + // async not supported here, .Result is all we have + _ = slskd.Blacklist.DetectFormat(File).Result; } - catch (FormatException ex) + catch { - results.Add(new ValidationResult(ex.Message)); + results.Add(new ValidationResult("Failed to detect blacklist format. Only CIDR, P2P and DAT formats are supported")); } return results; |
