Skip to content

Commit

Permalink
[mqtt.homeassistant] Include the details of JSON syntax errors when p…
Browse files Browse the repository at this point in the history
…arsing fails (openhab#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 openhab#17375.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
  • Loading branch information
ccutrer authored Sep 20, 2024
1 parent deca335 commit ab2dade
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public static <C extends AbstractChannelConfiguration> 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);
}
}
}

0 comments on commit ab2dade

Please sign in to comment.