Francois Gouget : testbot/WineRunReconfig: Fix error handling.

Alexandre Julliard julliard at winehq.org
Fri Mar 29 09:39:22 CDT 2019


Module: tools
Branch: master
Commit: 238f558da64b33df67b46fa9feea147c0b934b35
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=238f558da64b33df67b46fa9feea147c0b934b35

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Fri Mar 29 15:18:17 2019 +0100

testbot/WineRunReconfig: Fix error handling.

It only makes sense to defer errors until we have retrieved the
reconfiguration log, at which point we either clear errors if it
indicates success, or handle any previous error.
Retrieving any binaries and data files should come after that.
This avoids using an undefined $NewStatus when connection errors occur.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/bin/WineRunReconfig.pl | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index fd9a56d..378bd94 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -413,6 +413,16 @@ elsif (!defined $TAError)
   $TAError = "An error occurred while retrieving the reconfig log: ". $TA->GetLastError();
 }
 
+# Report the reconfig errors even though they may have been caused by
+# TestAgent trouble.
+LogTaskError($ErrMessage) if (defined $ErrMessage);
+FatalTAError(undef, $TAError) if (defined $TAError);
+
+
+#
+# Grab the test executables and reference files
+#
+
 if ($NewStatus eq "completed")
 {
   use File::Copy;
@@ -427,7 +437,7 @@ if ($NewStatus eq "completed")
       }
       elsif (!defined $TAError)
       {
-        $TAError = "An error occurred while retrieving the $Bitness bit TestLauncher: ". $TA->GetLastError();
+        FatalTAError($TA, "An error occurred while retrieving the $Bitness bit TestLauncher");
       }
     }
   }
@@ -441,18 +451,13 @@ if ($NewStatus eq "completed")
     }
     elsif (!defined $TAError)
     {
-      $TAError = "An error occurred while retrieving '$TaskDir/$FileName': ". $TA->GetLastError();
+      FatalTAError($TA, "An error occurred while retrieving '$TaskDir/$FileName'");
     }
   }
 }
 
 $TA->Disconnect();
 
-# Report the reconfig errors even though they may have been caused by
-# TestAgent trouble.
-LogTaskError($ErrMessage) if (defined $ErrMessage);
-FatalTAError(undef, $TAError) if (defined $TAError);
-
 
 #
 # Update the build VM's snapshot




More information about the wine-cvs mailing list