From 48c96f98c8504a10236e8f52b90f075a818c8259 Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Fri, 20 Sep 2024 12:47:20 -0600 Subject: [PATCH] [mqtt.homeassistant] Include the details of JSON syntax errors when parsing fails (#17452) While it's useful in general to not have to copy/paste a MQTT message into a JSON parser to verify syntax, it also includes details about fields that are the wrong data type that a generic JSON parser won't catch. A la #17375. Signed-off-by: Cody Cutrer Signed-off-by: Ciprian Pascu --- .../internal/config/dto/AbstractChannelConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/config/dto/AbstractChannelConfiguration.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/config/dto/AbstractChannelConfiguration.java index 6d606d9777e..7880b2cf433 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/config/dto/AbstractChannelConfiguration.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/config/dto/AbstractChannelConfiguration.java @@ -226,7 +226,7 @@ public abstract class AbstractChannelConfiguration { } return config; } catch (JsonSyntaxException e) { - throw new ConfigurationException("Cannot parse channel configuration JSON", e); + throw new ConfigurationException("Cannot parse channel configuration JSON: " + e.getMessage(), e); } } }