瀏覽代碼

Improve error message in ftslave for wrong ip

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 13 年之前
父節點
當前提交
cace405b03
共有 2 個文件被更改,包括 10 次插入2 次删除
  1. 4 1
      dali/ft/fterror.hpp
  2. 6 1
      dali/ft/fttransform.cpp

+ 4 - 1
dali/ft/fterror.hpp

@@ -81,6 +81,7 @@
 #define DFTERR_ReplicateSameFormat              8194
 #define DFTERR_PartitioningZeroSizedRowLink     8195
 #define DFTERR_CopyAborted                      8196
+#define DFTERR_WrongComputer                    8197
 
 
 //---- Text for all errors (make it easy to internationalise) ---------------------------
@@ -135,7 +136,9 @@
 #define DFTERR_OutputOffsetMismatch_Text        "INTERNAL: Output offset does not match expected (%"I64F"d expected %"I64F"d) at %s of block %d"
 #define DFTERR_NoSolarisDir_Text                "Directory not yet supported for solaris"
 #define DFTERR_NoSolarisCopy_Text               "Copy not yet supported for solaris"
-#define DFTERR_ReplicateSameFormat_Text         "INTERNAL: Replciate cannot convert formats"
+#define DFTERR_ReplicateSameFormat_Text         "INTERNAL: Replicate cannot convert formats"
 #define DFTERR_PartitioningZeroSizedRowLink_Text        "Zero sized row link in source file at %"I64F"d - cannot partition"
 #define DFTERR_CopyAborted_Text                 "Copy failed - User Abort"
+#define DFTERR_WrongComputer_Text               "INTERNAL: Command send to wrong computer.  Expected %s got %s"
+
 #endif

+ 6 - 1
dali/ft/fttransform.cpp

@@ -576,7 +576,12 @@ void TransferServer::deserializeAction(MemoryBuffer & msg, unsigned action)
     SocketEndpoint ep;
     ep.deserialize(msg);
     if (!ep.isLocal())
-        assertex(!"Command transferred to the wrong computer!!!");
+    {
+        StringBuffer host, expected;
+        queryHostIP().getIpText(host);
+        ep.getIpText(expected);
+        throwError2(DFTERR_OutputOffsetMismatch, expected.str(), host.str());
+    }
 
     srcFormat.deserialize(msg);
     tgtFormat.deserialize(msg);