Closed kaikreuzer closed 7 years ago
yes, I can do it
Additional PR will be opened for the openhab2-addons bundle that are affected as well:
I will make a sample exception handling in the PR, but I guess the developers that implemented the bindings will take a look, if it is ok as well.
My log is full of errors like
This is due to the fact that the AVM Fritz binding is using HttpUtil for accessing the device and the device is not reachable (which is expected, because I am in a different network) - this should result in the Thing being OFFLINE, but not in a log cluttered with errors.
I would suggest to change the methods in HttpUtil to only log debug at max, but additionally to throw IOExceptions, so that the caller actually has a chance to notice that his call wasn't successfully executed.
The main reason that this wasn't done in the past is that
org.eclipse.smarthome.model.script.actions.HTTP
uses these methods and must not throw an exception (because it could not be handled within the scripts/rules). So this HTTP class should actually catch the IOExceptions and log an error instead.@svilenvul As you were working on HttpUtil in the past, would you be willing to implement this change (and check that the callers can deal with the newly introduced IOException)?