From ab2daded4c2d960a07e0eca64927ed8dde95c802 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 --- .../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 6d606d9777eb1..7880b2cf43302 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 static C fromString(final String } 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); } } }