domisol
Hi
I'm not sure if this is a LS issue, but after many tries and searches, I decided to post about my issue here.
I use node.js and lightstreamer-client-node module.
If I create a subscription :
mySubscription = new ls.Subscription(...);
and then I add listeners, for example :
mySubscription.addListener({
onSubscription: function() {
unexistentFunction();
}});
I have noticed that node won't trigger any errors, and the callback will silently stop executing (without returning).
For example, with this code, with this unexistentFunction. Also, is the functions exists but inside the functions there are errors, the same will occur.
Any way to recover the normal behavior, triggering exception errors ?
Thank you in advance
Jean-David
Alessandro.Carioni
Hello,
Callback errors are internally caught and aren’t propagated up the calling stack, since the Lightstreamer library must be able to work even in presence of user-side anomalies. Further, callbacks are called asynchronously and so eventual errors wouldn’t pop up where the callbacks are registered.
Therefore the only way to capture your own errors is to surround your functions with a try-catch.