tool/CommandFoeWrite.cpp
branch1.4-foe
changeset 1708 fae3a1759126
parent 1707 11ec009e145d
--- a/tool/CommandFoeWrite.cpp	Mon Jan 19 10:18:41 2009 +0000
+++ b/tool/CommandFoeWrite.cpp	Mon Jan 19 12:36:18 2009 +0000
@@ -1,6 +1,6 @@
 /*****************************************************************************
  *
- * $Id:$
+ * $Id$
  *
  ****************************************************************************/
 
@@ -13,6 +13,7 @@
 
 #include "CommandFoeWrite.h"
 #include "byteorder.h"
+#include "foe.h"
 
 /*****************************************************************************/
 
@@ -120,9 +121,15 @@
     } catch (MasterDeviceException &e) {
         if (data.buffer_size)
             delete [] data.buffer;
-        if (data.abort_code) {
-            err << "Failed to write via FoE: "
-                << errorString(data.abort_code);
+        if (data.result) {
+            if (data.result == FOE_OPCODE_ERROR) {
+                err << "FoE write aborted with error code 0x"
+                    << setw(8) << setfill('0') << hex << data.error_code
+                    << ": " << errorText(data.error_code);
+            } else {
+                err << "Failed to write via FoE: "
+                    << resultText(data.result);
+            }
             throwCommandException(err);
         } else {
             throw e;