[MOAB-dev] r4714 - MOAB/trunk/itaps/imesh

jvporter at wisc.edu jvporter at wisc.edu
Mon Apr 4 18:23:11 CDT 2011


Author: jvporter
Date: 2011-04-04 18:23:11 -0500 (Mon, 04 Apr 2011)
New Revision: 4714

Modified:
   MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
Log:
Fix some iMesh error handling


Modified: MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
===================================================================
--- MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp	2011-04-04 21:43:38 UTC (rev 4713)
+++ MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp	2011-04-04 23:23:11 UTC (rev 4714)
@@ -1579,6 +1579,9 @@
                        int *err,
                        const int tag_name_size)
   {
+    if (tag_size < 0)
+      ERROR(iBase_INVALID_ARGUMENT, "iMesh_createTag: invalid tag size");
+
     Tag new_tag;
     int this_size = tag_size;
 
@@ -1600,6 +1603,8 @@
         break;
       case iBase_BYTES:
         break;
+      default:
+        ERROR(iBase_INVALID_ARGUMENT, "iMesh_createTag: invalid tag data type");
     }
 
     ErrorCode result = MOABI->tag_create(tmp_tagname.c_str(), this_size,
@@ -2216,14 +2221,14 @@
       return;
 
     if (tag_values_size != (tag_size * entity_handles_size)) {
-      ERROR(iBase_INVALID_ARGUMENT,"iMesh_setArrData: bad tag_values_size passed.");
+      ERROR(iBase_BAD_ARRAY_SIZE, "iMesh_setArrData: bad tag_values_size passed.");
     }
 
     ErrorCode result = MOABI->tag_set_data(TAG_HANDLE(tag_handle),
                                            CONST_HANDLE_ARRAY_PTR(entity_handles),
                                            entity_handles_size,
                                            tag_values);
-    CHKERR(result,"iMesh_setArrData didn't succeed.");
+    CHKERR(result, "iMesh_setArrData didn't succeed.");
     RETURN(iBase_SUCCESS);
   }
 













More information about the moab-dev mailing list