Subject: | CDBI::Loader will fail w/o a proper error message |
Class::DBI::Loader
0.22
new() uses a regexp to tell which Class::DBI::Loader::* to use. It still tries to load something, even if the regexp didn't match anything.
It would be nice to die if the regexp doesn't match anything. Otherwise, the programmer ends up checking the code only to discover that they made a typo.
my ($driver) = $dsn =~ m/^dbi:(\w*?)(?:\((.*?)\))?:/i;
+ die "Didn't find a proper DSN in '$dsn'\n"
+ unless $driver;
$driver = 'SQLite' if $driver eq 'SQLite2';