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

Modbus: AbstractReadTask: Enhance Parsing Response; exception catch #2879

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Commits on Nov 20, 2024

  1. Enhance Parsing Response debug output

    More generic catch block for more detailed channel assignment errors. E.g. the original code is not able to catch the following kind of errors:
    [modbus1 ] ERROR [dbus.api.task.AbstractReadTask] Parsing Response failed. IllegalArgumentException: Unable to set value [-4395165653183430656] for Channel [battery0/ChrW]: Cannot convert. Long [-4395165653183430656] is not fitting in Integer range.
    
    This kind of messages would have been very helpful for detecting channel mapping errors, but it is not catched by OpenemsException
    clehne authored and DerStoecki committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    47542c5 View commit details
    Browse the repository at this point in the history
  2. added TestCase to cover General Exception

    Trigger IllegalArgumentException by adding a new Channel, and filling it with Integer.MAX value (not fitting in short range), catch the log and check for "IllegalArgumentException"
    -> For me : easiest way to catch the logError
    DerStoecki committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    10d2953 View commit details
    Browse the repository at this point in the history