Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
change mismatch_error to not_found_error where appropriate
[simgrid.git] / src / gras / Msg / msg.c
index 88d443fd9f7c6b757eeaf5bc25353ead3078dfb3..6ec3e4d56e58ea77926966c877fea87a0a01ac4b 100644 (file)
@@ -147,7 +147,7 @@ gras_msgtype_declare_v(const char           *name,
     msgtype = (gras_msgtype_t)xbt_set_get_by_name(_gras_msgtype_set,namev);
     found = 1;
   } CATCH(e) {
-    if (e.category != mismatch_error)
+    if (e.category != not_found_error)
       RETHROW;
     xbt_ex_free(e);
   }
@@ -205,7 +205,7 @@ gras_msg_send(gras_socket_t   sock,
   static gras_datadesc_type_t string_type=NULL;
 
   if (!msgtype)
-    THROW0(mismatch_error,0,
+    THROW0(arg_error,0,
           "Cannot send the NULL message (did msgtype_by_name fail?)");
 
   if (!string_type) {
@@ -248,9 +248,8 @@ gras_msg_recv(gras_socket_t    sock,
   TRY {
     gras_trp_chunk_recv(sock, header, 6);
   } CATCH(e) {
-    THROW2(e.category,e.value,
-          "Exception caught while trying to get the mesage header on socket %p : %s",
-          sock,e.msg);
+    RETHROW1("Exception caught while trying to get the mesage header on socket %p : %s",
+            sock);
   }
 
   for (cpt=0; cpt<4; cpt++)
@@ -482,6 +481,7 @@ gras_msg_handle(double timeOut) {
     }
   }
 
+  /* FIXME: gras_datadesc_free not implemented => leaking the payload */
   THROW1(mismatch_error,0,
         "Message '%s' refused by all registered callbacks", msgtype->name);
 }