mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-27 07:41:39 +01:00
Fix logging (#17119)
Signed-off-by: Leo Siepel <leosiepel@gmail.com> Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
parent
91c0f34594
commit
1a427f5f8a
@ -198,7 +198,10 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen
|
|||||||
// @Nullable
|
// @Nullable
|
||||||
String response = HttpUtil.executeUrl("GET", uri.toURL().toString(), 500);
|
String response = HttpUtil.executeUrl("GET", uri.toURL().toString(), 500);
|
||||||
properties = Optional.ofNullable(new Gson().fromJson(response, TVProperties.class));
|
properties = Optional.ofNullable(new Gson().fromJson(response, TVProperties.class));
|
||||||
} catch (JsonSyntaxException | URISyntaxException | IOException e) {
|
} catch (IOException e) {
|
||||||
|
logger.debug("{}: Cannot connect to TV: {}", host, e.getMessage());
|
||||||
|
properties = Optional.empty();
|
||||||
|
} catch (JsonSyntaxException | URISyntaxException e) {
|
||||||
logger.warn("{}: Cannot connect to TV: {}", host, e.getMessage());
|
logger.warn("{}: Cannot connect to TV: {}", host, e.getMessage());
|
||||||
properties = Optional.empty();
|
properties = Optional.empty();
|
||||||
}
|
}
|
||||||
@ -229,7 +232,7 @@ public class SamsungTvHandler extends BaseThingHandler implements RegistryListen
|
|||||||
} catch (InterruptedException | ExecutionException e) {
|
} catch (InterruptedException | ExecutionException e) {
|
||||||
logger.warn("{}: Cannot get TVProperties: {}", host, e.getMessage());
|
logger.warn("{}: Cannot get TVProperties: {}", host, e.getMessage());
|
||||||
}
|
}
|
||||||
logger.warn("{}: Cannot get TVProperties, return Empty properties", host);
|
logger.debug("{}: Cannot get TVProperties, return Empty properties", host);
|
||||||
return new TVProperties();
|
return new TVProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user