Comments (10)
This can happen on any request/observation that has not completed yet when the user calls reset()
. It's not a critical error but has to be there to notify the user that his request cannot be completed.
from node-tradfri-client.
for reference, this error I captured:
Error: CoapClient was reset
at normalizeReason (/myproject/node_modules/node-coap-client/build/lib/DeferredPromise.js:5:16)
at Promise.rej [as reject] (/myproject/node_modules/node-coap-client/build/lib/DeferredPromise.js:13:36)
at Function.reset (/myproject/node_modules/node-coap-client/build/CoapClient.js:191:33)
at TradfriClient.reset (/myproject/node_modules/node-tradfri-client/build/tradfri-client.js:158:39)
at tradfriClient.ping.catch.then (/myproject/app/lib/tradfriService.js:167:32)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
To reproduce:
- make sure you can control your lights
- disconnect ethernet not tradfri gateway
- send 10 commands (for example
turnOn
) to the gateway - wait a minute, then the error pops up
from node-tradfri-client.
Another option would capture this rejected promise and use the error callback to signal an error
from node-tradfri-client.
The error pops up, because you call reset
in your app:
at TradfriClient.reset (/myproject/node_modules/node-tradfri-client/build/tradfri-client.js:158:39) at tradfriClient.ping.catch.then (/myproject/app/lib/tradfriService.js:167:32)
from node-tradfri-client.
I know, it was just an idea, either update the docs that reset is an async function that returns a promise OR don't change the docs but use the error callback to signal the error.
from node-tradfri-client.
I'm leaning towards emitting a general library error and swallow the rejections. This means the corresponding documentation will have to state that all pending promises will neither be resolved or rejected anymore. Do you think this is good from a user's point of view?
Regarding your code snippet:
Are you catching rejections from ping
? IMO that should always resolve and never reject. Or am I misunderstanding your stack frame?
from node-tradfri-client.
I'm fine with swallowing the error and emitting an error - i think as long as the emitted error is understandable it should be fine and makes the implementation easier.
Yes I catch ping call, there was a rejection when I rebooted the gateway.
from node-tradfri-client.
Yes I catch ping call, there was a rejection when I rebooted the gateway.
DTLS timeout? If so, that's a bug since ping
should handle the errors itself.
from node-tradfri-client.
"CoapClient was reset" should now be swallowed and transformed into an "error"
event with a slightly more descriptive message.
from node-tradfri-client.
Released in v0.10.0
from node-tradfri-client.
Related Issues (20)
- Can set group brightness but not colour temperature HOT 9
- Other rgb ligths not recognized as rgb but as white HOT 3
- New properties in gateway firmware v1.13.21 HOT 3
- v2.2.0 build issues from shared-types HOT 3
- TRADFRI Shortcut-Button HOT 2
- Correctly iterating bulbs HOT 2
- Any news about support for motion sensor? HOT 6
- `device updated` events during transition time HOT 2
- problems with firmware 1.15.34 HOT 5
- Can no longer connect after being shut off during vacation HOT 2
- High transition time is ignored in my setup HOT 3
- The network stack was reset. crashes Node-Red HOT 3
- Amazing library - A big thank you HOT 1
- Unknown cipher in Electron HOT 39
- warnings about unknown properties
- UnhandledPromiseRejectionWarning while pairing HOT 2
- Check if switching to mdns-scanner makes sense
- discoverGateway returns null HOT 2
- Remote events HOT 1
- discoverGateway returns null when used across vlans(using a mdns reflector) HOT 1
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 node-tradfri-client.