better error reporting from rsync
[freeside.git] / FS / FS / part_export / textradius.pm
index 691753f..7480787 100644 (file)
@@ -55,7 +55,7 @@ sub textradius_insert { #subroutine, not method
 
   #silly arg processing
   my($att, @check);
-  push @check, $att while ($att=shift @attributes) ne '-';
+  push @check, $att while @attributes && ($att=shift @attributes) ne '-';
   my %check = @check;
   my %reply = @attributes;
 
@@ -126,7 +126,7 @@ sub textradius_download {
   $rsync->exec( {
     src  => "$user\@$host:$users",
     dest => $dest,
-  } );
+  } ) or die "error downloading $user\@$host:$users : ". $rsync->err;
 
   $dest;
 }
@@ -145,7 +145,7 @@ sub textradius_upload {
   $rsync->exec( {
     src  => "$dir/users",
     dest => "$user\@$host:$users",
-  } );
+  } ) or die "error uploading to $user\@$host:$users : ". $rsync->err;
 
   flock(LOCK,LOCK_UN);
   close LOCK;