From 862b118ae848e2126b0322100f0f6cf8a1bb88fd Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Fri, 20 Sep 2024 11:17:14 -0600 Subject: [PATCH] [mqtt.homeassistant] Include the details of JSON syntax errors when parsing fails 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. --- .../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); } } }