From: coldpeace Date: Mon, 15 Mar 2010 13:30:40 +0000 (+0000) Subject: detailed output messages if MSG_task_send failed X-Git-Tag: SVN~486 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/aa8517953e2f1156706b9803ac0d71662f0d342c detailed output messages if MSG_task_send failed git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7253 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/bindings/ruby/rb_msg_task.c b/src/bindings/ruby/rb_msg_task.c index 8ae106ad4a..ea770cc9dc 100644 --- a/src/bindings/ruby/rb_msg_task.c +++ b/src/bindings/ruby/rb_msg_task.c @@ -54,13 +54,23 @@ VALUE rb_task_execute(VALUE class,VALUE task) { // Sending Task void rb_task_send(VALUE class,VALUE task,VALUE mailbox) { + MSG_error_t rv; // Wrap Ruby Value to m_task_t struct m_task_t tk; Data_Get_Struct(task, s_m_task_t, tk); INFO1("Sending task %p",tk); - int res = MSG_task_send(tk,RSTRING(mailbox)->ptr); - if(res != MSG_OK) - rb_raise(rb_eRuntimeError,"MSG_task_send failed"); + rv = MSG_task_send(tk,RSTRING(mailbox)->ptr); + if(rv != MSG_OK) + { + if (rv == MSG_TRANSFER_FAILURE ) + rb_raise(rb_eRuntimeError,"Transfer failure while Sending"); + else if ( rv == MSG_HOST_FAILURE ) + rb_raise(rb_eRuntimeError,"Host failure while Sending"); + else if ( rv == MSG_TIMEOUT_FAILURE ) + rb_raise(rb_eRuntimeError,"Timeout failure while Sending"); + else + rb_raise(rb_eRuntimeError,"MSG_task_send failed"); + } } // Receiving Task (returns a Task)