-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception "TypeError Object.probe(ping.lib:ping-promise)" #122
Comments
I am not familiar with sentry. What kind of user system is running on?
We r using system ping, which is not suitable on running in browser at all.
R u running our library on browser?
在 2020年6月24日週三 14:10,Ingo Fischer <[email protected]> 寫道:
… Hi,
we use ping ^0.2.3 in one project and we have Sentry as crash reporting
tool integrated. We got one exception from a users system about an
exception. Maybe you want to enhance error handing? :-)
Details:
https://sentry.iobroker.net/share/issue/6444e16a395448bcabb48324d3da0ce4/
TypeError: Cannot read property 'on' of undefined
File "/opt/iobroker/node_modules/iobroker.shelly/node_modules/ping/lib/ping-promise.js", line 73, col 17, in Object.probe
ping.stdout.on('data', function (data) {
File "/opt/iobroker/node_modules/iobroker.shelly/node_modules/ping/lib/ping-sys.js", line 38, col 17, in Object.probe
return ping.probe(addr, _config).then(function (res) {
File "/opt/iobroker/node_modules/iobroker.shelly/lib/coap.js", line 29, col 14, in Promise
ping.sys.probe(host, (isAlive) => {
?, in new Promise
File "/opt/iobroker/node_modules/iobroker.shelly/lib/coap.js", line 28, col 10, in pingAsync
return new Promise((resolve, reject) => {
File "/opt/iobroker/node_modules/iobroker.shelly/lib/coap.js", line 459, col 23, in CoAPClient.httpIoBrokerState
let alive = await pingAsync(this.getIP());
File "/opt/iobroker/node_modules/iobroker.shelly/lib/coap.js", line 525, col 56, in Timeout.timerid.setTimeout [as _onTimeout]
this.timerid = setTimeout(async () => await this.httpIoBrokerState(), this.polltime);
File "timers.js", line 436, col 11, in ontimeout
File "timers.js", line 300, col 5, in tryOnTimeout
File "timers.js", line 263, col 5, in listOnTimeout
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#122>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5YBI4C546MMJNDSFX3NDLRYGKEZANCNFSM4OGKURSQ>
.
|
Sentry is just a crash reporting too that reports crashes from user systems to us. |
In fact it is about "ping.stdout" is undefined in this case ... so it seems that something went wrong before which lead to this case. reason unknown ... but maybe it is a good idea (with knowing that it indeed happened to at least 1 user) to check for it. :-) |
If ping.stdout is none, there are some problems on |
When you google then it can happen that stdout is undefined ... you just need to check such cases before assuming it is there ... |
According to the manual, stdout will be none only if stdio option is set to be none. Since there is only 1 report regarding to this issue, it is reason for me to guess the output of cp.spawn in your work station. Let's say I simply test this condition, and reject the promise with error message "Missing stdout". It does not resolve the problem in your case. |
It will allow to catch the error and return it to the user ... much better thenan async uncatchable exception :-) |
It is fine to capture such kind of errors. But, we still cannot find out why stdout is none. If we know why it is none, we may have a better solution than just simply capture such kind of errors |
I completely agree, but I have no idea. According to Sentry it affects 3 users at the moment |
Hey, @Apollon77 . I have wrapped the exception as requested. Combining the improvement in #128 , it may solves your issue. Please check the fix on master branch |
I checked the code - that should work. When released as NPM version can include it and we can see if the error happens again (btw I never had it myself, we just got crash reports from our sentry from other users) |
Patches are available on 0.4.0. Please create a new issue if there are any new problems. Thanks |
Hi,
we use ping ^0.2.3 in one project and we have Sentry as crash reporting tool integrated. We got one exception from a users system about an exception. Maybe you want to enhance error handing? :-)
Details:
https://sentry.iobroker.net/share/issue/6444e16a395448bcabb48324d3da0ce4/
The text was updated successfully, but these errors were encountered: