Skip to content

Commit 8ba01b4

Browse files
Merge pull request #424 from CNinnovation/381-clean-up-custom-exception-types
Replaced ConfigurationNotFoundException in CodeBreaker.Shared
2 parents 962a9d1 + 8fe93e8 commit 8ba01b4

2 files changed

Lines changed: 2 additions & 22 deletions

File tree

src/shared/CodeBreaker.Shared/Exceptions/ConfigurationNotFoundException.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
using CodeBreaker.Shared.Exceptions;
2-
using Microsoft.Extensions.Configuration;
3-
4-
namespace Microsoft.Extensions.Configuration;
1+
namespace Microsoft.Extensions.Configuration;
52

63
public static class ConfigExtensions
74
{
85
public static string GetRequired(this IConfiguration config, string configKey) =>
9-
config[configKey] ?? throw new ConfigurationNotFoundException(configKey);
6+
config[configKey] ?? throw new InvalidOperationException($"Could not find configuration with key: \"{configKey}\"");
107
}

0 commit comments

Comments
 (0)