This commit is contained in:
Quentin Garnier 2015-03-10 08:10:00 +11:00
parent 6a1730d91b
commit 116128ba98
1 changed files with 3 additions and 2 deletions

View File

@ -192,11 +192,12 @@ sub connect {
);
if (!defined($self->{instance})) {
my $err_msg = sprintf("Cannot connect: %s", defined($DBI::errstr) ? $DBI::errstr : "(no error string)");
if ($dontquit == 0) {
$self->{output}->add_option_msg(short_msg => "Cannot connect: " . $DBI::errstr);
$self->{output}->add_option_msg(short_msg => $err_msg);
$self->{output}->option_exit(exit_litteral => $self->{sql_errors_exit});
}
return (-1, "Cannot connect: " . $DBI::errstr);
return (-1, $err_msg);
}
$self->{version} = $self->{instance}->get_info(18); # SQL_DBMS_VER