[marketplace] Update CommunityUIWidgetAddonHandler.java to give a more helpful error (#4052)

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 <matt@pcmus.com>
pull/3930/head
Matthew Skinner 2024-01-21 18:41:08 +11:00 committed by GitHub
parent 5c9f192764
commit 4905805ea8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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());