Skip to content

Commit

Permalink
Do not throw exception for invalid configuration file (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheenamalhotra authored May 29, 2020
1 parent df35d18 commit c6fa6bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ internal partial class SqlAuthenticationProviderManager
static SqlAuthenticationProviderManager()
{
var activeDirectoryAuthNativeProvider = new ActiveDirectoryNativeAuthenticationProvider();
SqlAuthenticationProviderConfigurationSection configurationSection;
SqlAuthenticationProviderConfigurationSection configurationSection = null;

try
{
configurationSection = (SqlAuthenticationProviderConfigurationSection)ConfigurationManager.GetSection(SqlAuthenticationProviderConfigurationSection.Name);
}
catch (ConfigurationErrorsException e)
catch (ConfigurationErrorsException)
{
throw SQL.CannotGetAuthProviderConfig(e);
// Don't throw an error for invalid config files
}

Instance = new SqlAuthenticationProviderManager(configurationSection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;

namespace Microsoft.Data.SqlClient
Expand Down

0 comments on commit c6fa6bd

Please sign in to comment.