UnhandledPromiseRejectionWarning
See original GitHub issueUnhandledPromiseRejectionWarning: Error: TCP Timeout
at Timeout.setTimeout [as _onTimeout] (/.../node_modules/tplink-smarthome-api/lib/client.js:228:20)
at listOnTimeout (internal/timers.js:535:17)
at processTimers (internal/timers.js:479:7)
script as easy as
client.getDevice({host: '192.168.1.126'}).then((device)=>{
device.setPowerState(true);
console.log( d.toLocaleTimeString() + ' power on!');
timeoutObj = setTimeout(pOff, 30*1000); // 30s -> off
});
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Getting a UnhandledPromiseRejectionWarning when ...
On the console I'm getting an 'UnhandledPromiseRejectionWarning' even though the reject function is getting called since it instantly shows the message ...
Read more >What is UnhandledPromiseRejectionWarning
The Promise.reject() method returns a Promise object that is rejected with a given reason. The unhandledrejection event is sent to the global scope...
Read more >Fixing UnhandledPromiseRejectionWarning in Node.js
If we fail to handle a Promise rejection, we're shown the UnhandledPromiseRejectionWarning by Node.js. const slowAndSteady = new Promise( ...
Read more >Unhandled Promise Rejections in Node.js
If you want to suppress the unhandled promise rejection warning, all you need to do is call .catch() on the promise with an...
Read more >Unhandled Promise Rejection Warning
I keep getting this error when I run my code UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m still not able to replicate this issue, at least not in the current version. I don’t get any unhandled rejections.
tplink-smarthome-api
: v2.0.0node --version
: v12.16.3And when I disable my networking:
@plasticrake Thanks. I ran some tests with different versions of nodejs and tplink-smarthome-api on docker. I got variable stack traces on the ENETUNREACH error, but no unhandled rejections after 1.2.0. So, I think 1.3.0 fixed the problem.