Skip to content

Commit 51f510f

Browse files
committed
[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 openhab#17375.
1 parent 2df7ad4 commit 51f510f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/config/dto/AbstractChannelConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public static <C extends AbstractChannelConfiguration> C fromString(final String
226226
}
227227
return config;
228228
} catch (JsonSyntaxException e) {
229-
throw new ConfigurationException("Cannot parse channel configuration JSON", e);
229+
throw new ConfigurationException("Cannot parse channel configuration JSON: " + e.getMessage(), e);
230230
}
231231
}
232232
}

0 commit comments

Comments
 (0)