From 77c8bfd392c60b4d23acd9c3d91ef73416e4d3a4 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Fri, 19 Jun 2015 10:37:22 +0200
Subject: [PATCH] Improve logging for aborts

---
 src/hydra-queue-runner/hydra-queue-runner.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc
index 7558dfc8..c2a1fdd4 100644
--- a/src/hydra-queue-runner/hydra-queue-runner.cc
+++ b/src/hydra-queue-runner/hydra-queue-runner.cc
@@ -1070,8 +1070,6 @@ bool State::doBuildStep(std::shared_ptr<StoreAPI> store, Step::ptr step,
         } catch (Error & e) {
             result.status = RemoteResult::rrMiscFailure;
             result.errorMsg = e.msg();
-            printMsg(lvlError, format("irregular failure building ‘%1%’ on ‘%2%’: %3%")
-                % step->drvPath % machine->sshName % e.msg());
         }
 
         if (result.status == RemoteResult::rrSuccess) res = getBuildResult(store, step->drv);
@@ -1082,6 +1080,8 @@ bool State::doBuildStep(std::shared_ptr<StoreAPI> store, Step::ptr step,
     /* The step had a hopefully temporary failure (e.g. network
        issue). Retry a number of times. */
     if (result.status == RemoteResult::rrMiscFailure) {
+        printMsg(lvlError, format("irregular failure building ‘%1%’ on ‘%2%’: %3%")
+            % step->drvPath % machine->sshName % result.errorMsg);
         bool retry;
         {
             auto step_(step->state.lock());