[MOAB-dev] r4707 - MOAB/trunk/src/io

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Thu Mar 31 18:30:30 CDT 2011


Author: kraftche
Date: 2011-03-31 18:30:30 -0500 (Thu, 31 Mar 2011)
New Revision: 4707

Modified:
   MOAB/trunk/src/io/ReadHDF5.cpp
Log:
propogate correct error code to caller in ReadHDF5, and a little more error output

Modified: MOAB/trunk/src/io/ReadHDF5.cpp
===================================================================
--- MOAB/trunk/src/io/ReadHDF5.cpp	2011-03-31 23:30:02 UTC (rev 4706)
+++ MOAB/trunk/src/io/ReadHDF5.cpp	2011-03-31 23:30:30 UTC (rev 4707)
@@ -561,8 +561,11 @@
   
   if (MB_SUCCESS == rval)
     dbgOut.tprint(1, "Read finished.\n");
-  else 
-    dbgOut.tprintf(1,"READ FAILED (ERROR CODE %d)\n", (int)rval);
+  else {
+    std::string msg;
+    iFace->get_last_error(msg);
+    dbgOut.tprintf(1,"READ FAILED (ERROR CODE %s): %s\n", ErrorCodeStr[rval], msg.c_str());
+  }
   
   if (H5P_DEFAULT != collIO)
     H5Pclose( collIO );
@@ -3236,10 +3239,8 @@
 
       rval = iFace->tag_set_data( tag_handle, ents, dataBuffer );
       if (MB_SUCCESS != rval) {
-        std::string err;
-        iFace->get_last_error(err);
-        dbgOut.printf(1,"Internal error setting data for tag \"%s\": %s\n", tn.c_str(), err.c_str());
-        return error(MB_FAILURE);
+        dbgOut.printf(1,"Internal error setting data for tag \"%s\"\n", tn.c_str());
+        return error(rval);
       }
     }
   }






















More information about the moab-dev mailing list