Comments (11)
We made a decision a while back to keep console output to a minimum since it often is abused in JS and can lead to a loss in performance. In place of it, we use EventEmitter2 to keep errors (and other output) event driven for those who are concerned with it (
Lines 380 to 382 in 9938d1b
I believe an error is printed to the console if an error is emitted and it's unhandled. For example, you could do:
Ros ros = new ROSLIB.Ros();
ros.on('error', function(error) {
console.log(error);
});
...
from roslibjs.
We made a decision a while back to keep console output to a minimum since it often is abused in JS and can lead to a loss in performance.
Yeah, a console message is written, but the console message is completely unhelpful (something along the lines of an "unhandled error"). In the case of the socket failure (which is a very fundamental thing), it would be better if it could report that the problem has to do with sockets in a more obvious way.
A colleague of mine was trying to use the RobotWebTools demos, but nothing was showing up other than the grid and root coordinate triad. It happens that nothing was showing up because the computer in question was on a wireless network which wasn't allowing the necessary ports through. Since the error message contained no information, it necessitated reading through code, downloading, and running a modified version which used the non-minified js scripts to figure out where the error was coming from.
So, since this error can happen even with the demos on the website (which would involve a user's first experience with RobotWebTools), I think an exception should be made to either output a console message, or display a message or alert which very explicitly explains that socket connections aren't being made. If that's still something you don't want to do, then there should at least be a prominent Troubleshooting section in the rosjs README.
from roslibjs.
(as an aside, these tools are awesome!)
from roslibjs.
👍 Thanks!
from roslibjs.
I think adding something to the README about how to handle errors and get error messages is a good idea. The reason its bad to just pop up alerts is that everyone is going to want to handle errors differently, therefore we added the event handling feature.
from roslibjs.
I think adding something to the README about how to handle errors and get error messages is a good idea. The reason its bad to just pop up alerts is that everyone is going to want to handle errors differently, therefore we added the event handling feature.
Do you think it would make sense to add an additional error handler just to the demo pages, so that if someone is trying them out they will see something prominent?
from roslibjs.
Yeah, that's a good idea since it will also explicitly show you how to create handlers.
from roslibjs.
Yeah, that's a good idea since it will also explicitly show you how to create handlers.
Yeah, that'd be great! Thanks Russell. I'm updating the issue title to reflect that.
from roslibjs.
I think adding something to the README about how to handle errors and get error messages is a good idea.
+1
Yeah, that's a good idea since it will also explicitly show you how to create handlers.
Another +1
:):):)
from roslibjs.
The demos now contain a status indicator and the wiki tutorials have been updated to show how to register listeners for the error
, close
and connection
messages.
I'm not closing this issue because I didn't put a note into the README yet.
from roslibjs.
I added the troubleshooting section f11baf0
from roslibjs.
Related Issues (20)
- Extending the documentation of ServiceRequest HOT 9
- Working demos 404 link HOT 3
- Better and more documentation HOT 6
- Publish doesn't work HOT 6
- configurable goal_id in roslib Goal HOT 2
- How to use the Move Group Interface with roslibjs (RobotWebTools)? HOT 7
- Unable to access http://robotwebtools.org HOT 3
- CommState for Action Client
- Correct CDN to use HOT 3
- What to do about ROS 2 support? HOT 12
- Increase general library quality HOT 3
- What to do with socket.io? HOT 2
- high speed CAN bus data missing messages
- V2 releases HOT 13
- Visualisation of PointCloud2/TF2 in browser with ROS2 HOT 1
- Develop branch doesn't work with npm - React HOT 3
- Ros2 Action Client does not let me send any more data to rosbridge after sending goal
- ROS2 cancel action_server goal HOT 2
- warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. HOT 2
- Subscription for PointCloud2 is not working HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from roslibjs.