Replace InvalidOperationException with custom config exception
Refactored DbModelOptions and EntityBaseOptions to throw DbModelConfigurationException instead of InvalidOperationException for configuration errors. Added necessary using directives for the new exception type to improve error clarity and specificity.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using ReC.Infrastructure.Options.Shared;
|
||||
using ReC.Infrastructure.Exceptions;
|
||||
using ReC.Infrastructure.Options.Shared;
|
||||
|
||||
namespace ReC.Infrastructure.Options;
|
||||
|
||||
@@ -18,6 +19,6 @@ public record DbModelOptions
|
||||
if(cluster.TryGetValue(nameof(T), out var entityOptions))
|
||||
entityOptions.EnsureProperties<T>();
|
||||
else
|
||||
throw new InvalidOperationException($"Entity options for type '{typeof(T).FullName}' not found.");
|
||||
throw new DbModelConfigurationException($"Entity options for type '{typeof(T).FullName}' not found.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user