--- loncom/interface/longroup.pm 2006/06/22 14:19:18 1.4 +++ loncom/interface/longroup.pm 2006/06/26 22:20:57 1.5 @@ -70,12 +70,9 @@ sub coursegroups { $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 @@ sub group_changes { 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 {