Skip to content

Commit aff87e3

Browse files
committed
Added error message from rosbridge to failedCallback
1 parent e6df311 commit aff87e3

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

build/roslib.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,8 @@ ROSLIB.Service = function(options) {
706706
* @param request - the ROSLIB.ServiceRequest to send
707707
* @param callback - function with params:
708708
* * response - the response from the service request
709-
* @param failedCallback - the callback function when the service call failed (optional)
709+
* @param failedCallback - the callback function when the service call failed (optional). Params:
710+
* * error - the error message reported by ROS
710711
*/
711712
ROSLIB.Service.prototype.callService = function(request, callback, failedCallback) {
712713
this.ros.idCounter++;
@@ -715,7 +716,7 @@ ROSLIB.Service.prototype.callService = function(request, callback, failedCallbac
715716
this.ros.once(serviceCallId, function(message) {
716717
if (message.result !== undefined && message.result === false) {
717718
if (typeof failedCallback === 'function') {
718-
failedCallback();
719+
failedCallback(message.values);
719720
}
720721
} else {
721722
var response = new ROSLIB.ServiceResponse(message.values);

0 commit comments

Comments
 (0)