]> git.basschouten.com Git - openhab-addons.git/commitdiff
[mqtt.homeassistant] Include the details of JSON syntax errors when parsing fails...
authorCody Cutrer <cody@cutrer.us>
Fri, 20 Sep 2024 18:47:20 +0000 (12:47 -0600)
committerGitHub <noreply@github.com>
Fri, 20 Sep 2024 18:47:20 +0000 (20:47 +0200)
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 <cody@cutrer.us>
bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/config/dto/AbstractChannelConfiguration.java

index 6d606d9777eb1bdc73db3fabc848387f8d6f8863..7880b2cf433023721ca718905072f05b44f92bb8 100644 (file)
@@ -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);
         }
     }
 }