mfenniak / rethinkdb-net

A C# / .NET client driver for RethinkDB.
Other
247 stars 37 forks source link

Update ConfigurationAssembler.cs #257

Open BartNetJS opened 7 years ago

BartNetJS commented 7 years ago

remove quotes from argumentException in CreateConnectionFactory to throw real cluster name

nkreipke commented 7 years ago

The constructor for ArgumentException requires its second argument to be the name of the invalid argument:

public ArgumentException(
    string message,
    string paramName
)

https://msdn.microsoft.com/en-us/library/sxykka64(v=vs.110).aspx

You should not pass arbitrary strings here. A better approach would be:

throw new ArgumentException($"Cluster name \"{clusterName}\" could not be found in configuration", nameof(clusterName));