Closed mcm1957 closed 1 year ago
There i need to think how to handle cases where somewhere in the middle of the process the object is not delivering the expected values. @mcm1957 do you think we should issue an error log or just a warning log for such catched errors?
Depends on the situation:
If this is a situation which can occure in normal operation, neither warning nur error is needed. In most cases even no try/catch will be necessary then but a normal if (obj && obj.element ...) or even ... obj?.element... code sequence will do it and either some action will be skipped or processed with a default value.
If the situation is really unexpected (i.e. the fronius reports the voltage of 2 phases but the third phase is missing in response) logging a warning should be ok. This would allow the user to (tempory) change logging to error if the warnings are too often while the overall operation is still ok.
If the adapter need to terminate / restart / drop the connection and reinitialize itself or cannot do any useful operation an erro will be OK.
There i need to think how to handle cases where somewhere in the middle of the process the object is not delivering the expected values.
If you have the situation where the system sends an answerblock but some data is missing you could evaluate whether ist acceptable to simple set the states to null (and optionally set a siutable q flag) indicating "well - fronius did not send currentz power value ...")
Part of Release 2.0.2
Adapter crashes at restart of fronius system:
An exception stating problems would be OK, a crash must be avoided.
Detail log see comments at forum: