openems icon indicating copy to clipboard operation
openems copied to clipboard

Modbus: AbstractReadTask: Enhance Parsing Response; exception catch

Open DerStoecki opened this issue 1 year ago • 2 comments

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

DerStoecki avatar Nov 19 '24 10:11 DerStoecki

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #2879      +/-   ##
=============================================
+ Coverage      57.31%   57.34%   +0.03%     
- Complexity      9156     9163       +7     
=============================================
  Files           2177     2177              
  Lines          92873    92873              
  Branches        6883     6883              
=============================================
+ Hits           53221    53245      +24     
+ Misses         37701    37680      -21     
+ Partials        1951     1948       -3     
---- 🚨 Try these New Features:

codecov[bot] avatar Nov 19 '24 10:11 codecov[bot]

@DerStoecki Could you please add an appropriate Junit Testcase, so that Codecov runs through.

clehne avatar Nov 19 '24 17:11 clehne