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

Fixed exception for malformed messages #101

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

lmartorella
Copy link
Contributor

Fixed ArgumentOutOfRangeException exception in case of malformed messages, shorter than 2 bytes.
Since the check for malformed messages is already in place, with this fix we can avoid unexpected exceptions.
Thx, L!

@lmartorella
Copy link
Contributor Author

Added another case of "ArgumentOutOfRangeException" raise in case the modbus error received is custom and not one of the predefined ones.
For uniformity of API, it should be correct to raise the same exception type "ModbusException" also for such cases, with a generic error message.

@Apollo3zehn Apollo3zehn changed the title - Fixed exception for malformed messages Fixed exception for malformed messages Feb 7, 2024
@Apollo3zehn Apollo3zehn changed the base branch from master to dev February 20, 2024 08:34
@Apollo3zehn
Copy link
Owner

Thanks for your contribution and sorry for being so late

@Apollo3zehn Apollo3zehn merged commit 895b54b into Apollo3zehn:dev Feb 20, 2024
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