-
Notifications
You must be signed in to change notification settings - Fork 201
Consider adding callback for load or reload errors for all providers #572
Comments
This makes sense to me. If we add this more general purpose extension I think we should discuss in detail how we make the file-based providers converge to it and how much compatibility we need to maintain. I think it is possible to make the pattern more generic by changing some of the property types on https://github.com/aspnet/Configuration/blob/dev/src/Microsoft.Extensions.Configuration.FileExtensions/FileLoadExceptionContext.cs. Hopefully we can figure a way so that usability for file-based providers is not affected. |
We can certainly push it into base, but then it needs to go onto then base ConfigurationProviderSource as well |
We'd probably also have to change the current ConfigurationProvider Load() to be non virtual and introduce another virtual load to automatically hook this up |
@divega do you want me to take a look at this for 2.0? |
Extension of the issue #489.
As for now, it is possible to handle exception occurring on load only for file-based providers.
Exceptions may occurs with every provider, especially with remote providers like Azure Key Vault & Redis providers. The
SetFileLoadExceptionHandler()
extension method should be replaced by a more genericSetLoadExceptionHandler()
method.Question : Can the handler be generic enough for been common to all providers ?
Or should it be specific for each provider and defined in the AddXxx() method ?
The text was updated successfully, but these errors were encountered: