From 4905805ea8f7b49fd45fbfca5069f0e2125351df Mon Sep 17 00:00:00 2001 From: Matthew Skinner Date: Sun, 21 Jan 2024 18:41:08 +1100 Subject: [PATCH] [marketplace] Update CommunityUIWidgetAddonHandler.java to give a more helpful error (#4052) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Installing from marketplace gives an Error that is not very helpful. Couldn’t find the widget in the add-on entry The cause was missing ```yaml code fence when a normal code fence was used. This used to work in the past so a number of widgets are done this way and will not install. Suggest a more useful message to help guide widget devs. Signed-off-by: Matthew Skinner --- .../internal/community/CommunityUIWidgetAddonHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.core.addon.marketplace/src/main/java/org/openhab/core/addon/marketplace/internal/community/CommunityUIWidgetAddonHandler.java b/bundles/org.openhab.core.addon.marketplace/src/main/java/org/openhab/core/addon/marketplace/internal/community/CommunityUIWidgetAddonHandler.java index 032db5af9..f16f38a71 100644 --- a/bundles/org.openhab.core.addon.marketplace/src/main/java/org/openhab/core/addon/marketplace/internal/community/CommunityUIWidgetAddonHandler.java +++ b/bundles/org.openhab.core.addon.marketplace/src/main/java/org/openhab/core/addon/marketplace/internal/community/CommunityUIWidgetAddonHandler.java @@ -86,7 +86,8 @@ public class CommunityUIWidgetAddonHandler implements MarketplaceAddonHandler { } else if (yamlContent != null) { addWidgetAsYAML(addon.getUid(), yamlContent); } else { - throw new IllegalArgumentException("Couldn't find the widget in the add-on entry"); + throw new IllegalArgumentException( + "Couldn't find the widget in the add-on entry. The starting code fence may not be marked as ```yaml"); } } catch (IOException e) { logger.error("Widget from marketplace cannot be downloaded: {}", e.getMessage());