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

Unify error handling procedure #5

Open
ceremcem opened this issue Jul 2, 2022 · 0 comments
Open

Unify error handling procedure #5

ceremcem opened this issue Jul 2, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ceremcem
Copy link
Owner

ceremcem commented Jul 2, 2022

Currently two different error management approaches are used. One uses return modbus_lib_send_error(MBUS_RESPONSE_SERVICE_DEVICE_FAILURE) and other uses return MBUS_RESPONSE_SERVICE_DEVICE_FAILURE in modbus_lib_read_handler and modbus_lib_write_handler respectively.

Proper approach might be using modbus_lib_send_error() for both of them (reverse the #4 changes) or create a relevant error function for each error code in order to get rid of writing modbus_lib_send_error, which will become:

return MBUS_RESPONSE_SERVICE_DEVICE_FAILURE();
@ceremcem ceremcem added the enhancement New feature or request label Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant