Skip to content

Commit 56da11a

Browse files
committed
Throw ArgumentException from connection string builder.
This matches other ADO.NET providers and is more semantically correct.
1 parent 478d805 commit 56da11a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MySqlConnector/MySql.Data.MySqlClient/MySqlConnectionStringBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public static MySqlConnectionStringOption TryGetOptionForKey(string key) =>
295295
s_options.TryGetValue(key, out var option) ? option : null;
296296

297297
public static MySqlConnectionStringOption GetOptionForKey(string key) =>
298-
TryGetOptionForKey(key) ?? throw new InvalidOperationException("Option '{0}' not supported.".FormatInvariant(key));
298+
TryGetOptionForKey(key) ?? throw new ArgumentException("Option '{0}' not supported.".FormatInvariant(key));
299299

300300
public string Key => m_keys[0];
301301
public IReadOnlyList<string> Keys => m_keys;

0 commit comments

Comments
 (0)