Skip to content

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

@estan

Description

@estan

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!).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions