From: Miguel de Icaza Date: Sat, 15 Mar 2008 19:38:17 +0000 (-0000) Subject: Improve error message, based ona patch from Brad Langhorst X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=f2dbed88116fc0b77c60ca2cd9e439d3cae65f17;p=mono.git Improve error message, based ona patch from Brad Langhorst svn path=/trunk/mcs/; revision=98395 --- diff --git a/mcs/class/Mono.Data/ProviderFactory.cs b/mcs/class/Mono.Data/ProviderFactory.cs index f86fce1bf84..7f0d9899675 100644 --- a/mcs/class/Mono.Data/ProviderFactory.cs +++ b/mcs/class/Mono.Data/ProviderFactory.cs @@ -99,6 +99,10 @@ namespace Mono.Data throw new System.ArgumentNullException ("ConnectionString"); Provider provider = providers [ProviderName]; + + if (provider == null) + throw new ArgumentException ("ProviderName", "The specified provider does not exist"); + IDbConnection conn = provider.CreateConnection (); conn.ConnectionString = ConnectionString; return conn;