[ros-users] Throwing exceptions in services (Python vs. C++)

Dirk Thomas mail at dirk-thomas.net
Thu Dec 8 12:54:46 UTC 2011

I have created and attached a patch for issue https://code.ros.org/trac/ros/ticket/3590

It currently does the following:
- for every std::exception already catched on the server it passes the e.what() to the client (as rospy and roslisp already do)
- output an error message on the client containing the exception string in case of server-side exceptions

One open question is if a new exception should be introduced (ServiceException similar to rospy)?

Then only error messages from ServiceException would be passed from server to client (other exceptions are handled without passing the error message).
And on the client the same exception-type could be (re-)thrown.
While this approach looks much cleaner it work break with the current behavior.

What is your opinion on the patch?
Would you vote to modify the patch to introduce a ServiceException as described above?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: issue3590.patch
Type: text/x-patch
Size: 2814 bytes
Desc: not available
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20111208/889077b5/attachment-0004.bin>

More information about the ros-users mailing list