Skip to content
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

missing error handling #22

Closed
kapet opened this issue May 11, 2021 · 2 comments
Closed

missing error handling #22

kapet opened this issue May 11, 2021 · 2 comments

Comments

@kapet
Copy link
Contributor

kapet commented May 11, 2021

My Nuki bridge occasionally responds with 'success: false' to lock status requests.
(also reported here: https://developer.nuki.io/t/success-false-despite-internal-retry/10324 )

The nuki-bridge-api kind-of handles this by checking for success==true and throwing an error if it's getting a false. Unfortunately, this Node Red node isn't handling this error when it happens - the only thing I see is an error in the syslog:
May 11 20:34:24 node-red Node-RED[2164]: Unhandled rejection (<{"success":false}>, no stack trace)

I've simply added this after the lockState().then(...) blocks (lines 199 and 209 in nuki.js):
.catch(function(err) {
msg.payload = {'error': 'failed sending lock action command'};
underControl.send(msg);
return;
});

With this I get a message out of the node so that I can retry :-)

I haven't seen it specifically but I suspect the lockAction() promise on line 194 could have the same problem.

@mabunixda
Copy link
Owner

@kapet do you implemented this in a fork? please open a PR for this change

@kapet kapet mentioned this issue Aug 6, 2021
@kapet
Copy link
Contributor Author

kapet commented Oct 12, 2021

has been fixed and works fine, nuki node emits a message with payload.error set to a string if this happens

@kapet kapet closed this as completed Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants