show errors for catalog items that can't be loaded
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/119ca3a5 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/119ca3a5 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/119ca3a5 Branch: refs/heads/0.5.0 Commit: 119ca3a52144753d01c8e4f2d744018062bb9206 Parents: b4924ac Author: Alex Heneveld <[email protected]> Authored: Sun Dec 2 12:46:36 2012 -0800 Committer: Alex Heneveld <[email protected]> Committed: Sun Dec 2 12:46:36 2012 -0800 ---------------------------------------------------------------------- .../src/main/webapp/assets/js/view/catalog.js | 21 +++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/119ca3a5/usage/jsgui/src/main/webapp/assets/js/view/catalog.js ---------------------------------------------------------------------- diff --git a/usage/jsgui/src/main/webapp/assets/js/view/catalog.js b/usage/jsgui/src/main/webapp/assets/js/view/catalog.js index e1f5690..e56dbdb 100644 --- a/usage/jsgui/src/main/webapp/assets/js/view/catalog.js +++ b/usage/jsgui/src/main/webapp/assets/js/view/catalog.js @@ -124,11 +124,22 @@ define([ $("#details-"+that.activeAccordion).html(_.template(DetailsGenericHtml, { title: that.activeItem })); - $.get(url, function (data) { - $("#details-"+that.activeAccordion).html(_.template(DetailsGenericHtml, { - title: that.activeItem, - json: FormatJSON(data) - })) + console.log("LOADING") + $.ajax({ url: url, + + success: function(data) { + $("#details-"+that.activeAccordion).html(_.template(DetailsGenericHtml, { + title: that.activeItem, + json: FormatJSON(data) + })) + }, + error: function(xhr, textStatus, error) { + $("#details-"+that.activeAccordion).html(_.template(DetailsGenericHtml, { + title: that.activeItem, + json: FormatJSON({ "status": textStatus, "error": error }) + })) + // xhr has a lot more data, including responseText, which we could show + } }) } else { that.showLocationDetails(that.activeItem)
