[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 <cody@cutrer.us>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
Cody Cutrer 2024-09-20 12:47:20 -06:00 committed by Ciprian Pascu
parent 522b33cc9a
commit 48c96f98c8

View 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);
}
}
}