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

Add more convenient API for checking if response is error? #82

Closed
estan opened this issue May 3, 2015 · 0 comments
Closed

Add more convenient API for checking if response is error? #82

estan opened this issue May 3, 2015 · 0 comments

Comments

@estan
Copy link
Contributor

estan commented May 3, 2015

In some of the examples I've seen e.g:

assert(rq.function_code < 0x80)

Is this the canonical way to check if a response is an error or not? If so, what's the best way to pinpoint what kind of error it was? Check the exception_code against ModbusExceptions?

Note sure how the API could be improved, but would be nice if there were some more examples of error handling in the examples (which are great!).

@dhoomakethu dhoomakethu added this to the 2.0.0 milestone Dec 23, 2017
rahulraghu94 pushed a commit that referenced this issue Jan 12, 2018
rahulraghu94 pushed a commit that referenced this issue Jan 30, 2018
dhoomakethu pushed a commit that referenced this issue Apr 27, 2018
* easily to check for errors in stead of having to manually compare
response codes
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants