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

handle lookup errors when connecting #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ncopa
Copy link
Contributor

@ncopa ncopa commented Jun 12, 2023

Connect may result in lookup error, which was not handled. Solve this by use a default error handler which returns whatever mosquitto reports.

This prevents us from missing errors.

@karlp
Copy link
Contributor

karlp commented Jun 12, 2023

Given that we still have some of the error codes enumerated, would it perhaps make more sense to leave the others that were enumerated, and just add a default case, perhaps with a "warning, missing enums in library handling!" ?

algitbot pushed a commit to alpinelinux/aports that referenced this pull request Jun 12, 2023
Ensure that lua 5.4 module is installed in correct location.

Fix error handling, for lookup errors.
ref: flukso/lua-mosquitto#37
@ncopa
Copy link
Contributor Author

ncopa commented Jun 12, 2023

The idea was to only handle the special cases:

  • success
  • errno
  • errors that should raise a lua error

And then just returns the error number with the mosquitto_strerror as default.

This helps us to deal with undocumented errors (like no connection) and future errors.

I dont think we need a warning for it.

One question though, I don't know we we should raise a lua error by default or return the error number.

algitbot pushed a commit to alpinelinux/aports that referenced this pull request Jun 12, 2023
Ensure that lua 5.4 module is installed in correct location.

Fix error handling, for lookup errors.
ref: flukso/lua-mosquitto#37
Connect may result in lookup error, which was not handled. Solve this by
use a default error handler which returns whatever mosquitto reports.

This prevents us from missing errors.
@ncopa
Copy link
Contributor Author

ncopa commented Jun 16, 2023

Given that we still have some of the error codes enumerated, would it perhaps make more sense to leave the others that were enumerated, and just add a default case, perhaps with a "warning, missing enums in library handling!" ?

Rebased it to do this, but I have no idea how to do the warning.

@karlp can you please have another look?

algitbot pushed a commit to alpinelinux/aports that referenced this pull request Jun 22, 2023
Ensure that lua 5.4 module is installed in correct location.

Fix error handling, for lookup errors.
ref: flukso/lua-mosquitto#37
algitbot pushed a commit to alpinelinux/aports that referenced this pull request Jun 22, 2023
Ensure that lua 5.4 module is installed in correct location.

Fix error handling, for lookup errors.
ref: flukso/lua-mosquitto#37
algitbot pushed a commit to alpinelinux/aports that referenced this pull request Jun 22, 2023
Ensure that lua 5.4 module is installed in correct location.

Fix error handling, for lookup errors.
ref: flukso/lua-mosquitto#37
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

Successfully merging this pull request may close these issues.

2 participants