roslibjs
roslibjs copied to clipboard
Report service errors from "op": "status"
I'm using ros2-web-bridge as a web-bridge and noticed that when doing a service call which caused a TypeError
on the webbridge the error was not reported in any of the callbacks (callback, failedCallback) of the client.
Client library call:
service.callService(new ROSLIB.ServiceRequest(args), handleResponse, handleError)
WS Request:
{
"op": "call_service",
"id": "call_service:coco/v1/stop_mapping:2",
"service": "coco/v1/stop_mapping",
"type": "api_v1_interfaces/srv/StopMapping",
"args": {
"foo": 1
}
}
WS Response:
{
"op": "status",
"level": "error",
"msg": "call_service: TypeError: Invalid argument: generate_localization_map in StopMapping_Request",
"id": "call_service:coco/v1/stop_mapping:2"
}
Are there plans to to propagate this kind of status with roslibjs
as well? Or is this some specifics of ros2-web-bridge
?
I could try to make a PR but I'm not sure if this is part of the standard that should be supported or not.
callService
has to following signature, so on error I would expect failedCallback
to be called. You say this is not happening?
Service.prototype.callService = function(request, callback, failedCallback) {
Correct - neither of the callbacks were called for me. I was using the npm package / v.1.1.0.
A PR to fix that would be appreciated :smile: