-
May 27th, 2020, 06:45 AM
#1
node.js | lightstreamer-client-node module not throwing errors in callbacks
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
-
May 27th, 2020, 10:24 AM
#2
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.
-
May 29th, 2020, 10:29 AM
#3
Grazie Alessandro, thanks for your answer, it's really welcome...
Similar Threads
-
By vpurohit in forum Client SDKs
Replies: 10
Last Post: January 23rd, 2017, 09:50 AM
-
By flybyGWT in forum Client SDKs
Replies: 3
Last Post: May 9th, 2014, 07:56 AM
-
By jonasby1 in forum General
Replies: 4
Last Post: February 16th, 2012, 08:47 AM
-
By lizsedley in forum Client SDKs
Replies: 1
Last Post: October 21st, 2009, 10:19 AM
-
By kishorekkk in forum Adapter SDKs
Replies: 1
Last Post: April 10th, 2009, 08:33 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 03:48 PM.
Bookmarks