[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>
pull/17453/head
Cody Cutrer 2024-09-20 12:47:20 -06:00 committed by GitHub
parent deca335cef
commit ab2daded4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

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