diff options
author | ivan <ivan> | 2008-07-15 23:25:09 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-07-15 23:25:09 +0000 |
commit | 7eab0f0ba06ae3f47f2ec6b06ad2a5596a5852a1 (patch) | |
tree | 327920c0902e4e28748e2e2d2bed2b1cfbfb289e /FS | |
parent | 0a2d11479a11e7aafc6e7a6273d51c74784b2839 (diff) |
where in the world is $DBI::errstr
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Upgrade.pm | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/FS/FS/Upgrade.pm b/FS/FS/Upgrade.pm index 55eed8ea1..6794f4d9f 100644 --- a/FS/FS/Upgrade.pm +++ b/FS/FS/Upgrade.pm @@ -117,20 +117,18 @@ sub upgrade_sqlradius { my @part_export = FS::part_export::sqlradius->all_sqlradius_withaccounting(); foreach my $part_export ( @part_export ) { + + my $errmsg = 'Error adding FreesideStatus to '. + $part_export->option('datasrc'). ': '; + my $dbh = DBI->connect( ( map $part_export->option($_), qw ( datasrc username password ) ), { PrintError => 0, PrintWarn => 0 } - ); - - unless ($dbh) { - warn "can't connect to RADIUS database ". - $part_export->option('datasrc'). ": $DBI::errstr\n"; + ) or do { + warn $errmsg.$DBI::errstr; next; - } + }; - my $errmsg = 'Error adding FreesideStatus to '. - $part_export->option('datasrc'). ': '; - my $str2time = str2time_sql( $dbh->{Driver}->{Name} ); my $group = "UserName"; $group .= ",Realm" |