Index: trunk/tools/czartool/CzarDb.pm
===================================================================
--- trunk/tools/czartool/CzarDb.pm	(revision 28714)
+++ trunk/tools/czartool/CzarDb.pm	(revision 28715)
@@ -34,5 +34,5 @@
 ###########################################################################
 sub getCurrentLabels {
-    my ($self, $server) = @_;
+    my ($self, $server, $labels) = @_;
 
     my $query = $self->{_db}->prepare(<<SQL);
@@ -43,7 +43,14 @@
 SQL
 
-    $query->execute;
-
-    return $query->fetchall_arrayref();
+
+    if (!$query->execute) {
+
+        print "WARNING: getCurrentLabels() failed\n";
+        return 0;
+    }
+
+    ${$labels} = $query->fetchall_arrayref();
+
+    return 1;
 }
 
Index: trunk/tools/roboczar.pl
===================================================================
--- trunk/tools/roboczar.pl	(revision 28714)
+++ trunk/tools/roboczar.pl	(revision 28715)
@@ -86,7 +86,6 @@
     my $reverting = 0;
     my $server = undef;
-
-    my $rows = undef; # TODO just call label
-        my $row;
+    my $rows = undef;
+    my $row = undef;
 
     while (1) {
@@ -94,8 +93,7 @@
         updateServerStatus();
         updateLabels();
-        $rows = $czarDb->getCurrentLabels("stdscience");
+        if (!$czarDb->getCurrentLabels("stdscience", \$rows)) {next;}
 
         foreach $stage (@stages) {
-            $totalNew=$totalFaults=$totalFull=0;
 
             $server = $pantasks->getServerForThisStage($stage);
@@ -105,4 +103,5 @@
             print "* Checking labels for $stage stage\n";
 
+            $totalNew=$totalFaults=$totalFull=0;
             foreach $row ( @{$rows} ) {
                 my ($label) = @{$row};
