[LON-CAPA-cvs] cvs: loncom /interface longroup.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 26 Jun 2006 22:20:58 -0000


albertel		Mon Jun 26 18:20:58 2006 EDT

  Modified files:              
    /loncom/interface	longroup.pm 
  Log:
  -morphed to use new lonnet error routine
  
  
Index: loncom/interface/longroup.pm
diff -u loncom/interface/longroup.pm:1.4 loncom/interface/longroup.pm:1.5
--- loncom/interface/longroup.pm:1.4	Thu Jun 22 10:19:18 2006
+++ loncom/interface/longroup.pm	Mon Jun 26 18:20:57 2006
@@ -70,12 +70,9 @@
         $cnum = $env{'course.'.$cid.'.num'};
     }
     my %curr_groups = &Apache::lonnet::get_coursegroups($cdom,$cnum,$group);
-    my ($tmp) = keys(%curr_groups);
-    if ($tmp=~/^(con_lost|no_such_host|error: [^2] )/) {
-        undef(%curr_groups);
+    if (my $tmp = &Apache::lonnet::error(%curr_groups)) {
+	undef(%curr_groups);
         &Apache::lonnet::logthis('Error retrieving groups: '.$tmp.' in '.$cnum.':'.$cdom);
-    } elsif ($tmp=~/^error: 2 /) {
-        undef(%curr_groups);
     }
     return %curr_groups;
 }
@@ -272,8 +269,7 @@
        if (@changegroups > 0) {
             my %currpriv;
             my %roleshash = &Apache::lonnet::dump('roles',$udom,$uname,$cid);
-            my ($tmp) = keys(%roleshash);
-            if ($tmp=~/^error:/) {
+	    if (my $tmp = &Apache::lonnet::error(%roleshash)) {
                 &Apache::lonnet::logthis('Error retrieving roles: '.$tmp.
                                          ' for '.$uname.':'.$udom);
             } else {