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

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.
  • Loading branch information
ccutrer committed Sep 20, 2024
1 parent deca335 commit 862b118
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 862b118

Please sign in to comment.