on xenial help sign in
Fix cardcreator and print debugging output on error.
commit95d9eaf7eed9b7778f952817a6e7c85e56254432 authorMichał Sawicz <michal.sawicz@canonical.com> dateThu 14 Aug 2014, 21:08 (12 years ago) parent96d3964
1 file changed+19−1
plugins/Dash/CardCreator.js+19−1
plugins/Dash/CardCreator.js+19−1
@@ -639,7 +639,12 @@ function cardString(template, components) {
639639 implicitHeight += 'titleLabel.y + titleLabel.height + units.gu(1);\n';
640640 } else if (hasArt) {
641641 implicitHeight += 'artShapeHolder.height;\n';
642+ } else {
643+ // No implicit height, close
644+ code += '}\n';
645+ return code
642646 }
647+
643648 // Close the AbstractButton
644649 code += implicitHeight + '}\n';
645650
@@ -653,5 +658,18 @@ function createCardComponent(parent, template, components) {
653658 var card = cardString(template, components);
654659 var code = imports + 'Component {\n' + card + '}\n';
655660
656− return Qt.createQmlObject(code, parent, "createCardComponent");
661+ var o = null;
662+ try {
663+ return Qt.createQmlObject(code, parent, "createCardComponent");
664+ } catch (e) {
665+ var k;
666+ console.error("ERROR: Invalid component created.");
667+ console.error("Template:");
668+ console.error(JSON.stringify(template));
669+ console.error("Components:");
670+ console.error(JSON.stringify(components));
671+ console.error("Code:");
672+ console.error(code);
673+ throw e;
674+ }
657675}