From d87b7a5e7430ab946c851208e45ddbf03330c98f Mon Sep 17 00:00:00 2001 From: lresende Date: Thu, 17 Jul 2008 00:36:25 +0000 Subject: TUSCANY-1961 - Properly reporting business and runtime exceptions to clients using jsonRPC binding git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@677479 13f79535-47bb-0310-9956-ffa450edef68 --- .../store/src/main/resources/uiservices/store.html | 49 +++++++++++++++------- 1 file changed, 35 insertions(+), 14 deletions(-) (limited to 'java/sca/samples/store/src/main/resources/uiservices') diff --git a/java/sca/samples/store/src/main/resources/uiservices/store.html b/java/sca/samples/store/src/main/resources/uiservices/store.html index 095570f949..45604463d1 100644 --- a/java/sca/samples/store/src/main/resources/uiservices/store.html +++ b/java/sca/samples/store/src/main/resources/uiservices/store.html @@ -35,20 +35,25 @@ var catalogItems; - function catalog_getResponse(items) { - var catalog = ""; - for (var i=0; i' + item + '
'; + function catalog_getResponse(items,exception) { + if(exception){ + alert(exception.message); + return; } - document.getElementById('catalog').innerHTML=catalog; - catalogItems = items; + var catalog = ""; + + for (var i=0; i' + item + '
'; + } + document.getElementById('catalog').innerHTML=catalog; + catalogItems = items; } function shoppingCart_getResponse(feed) { if (feed != null) { - var entries = feed.getElementsByTagName("entry"); + var entries = feed.getElementsByTagName("entry"); var list = ""; for (var i=0; i' + '' + catalogItems[i].name + '' + '' + catalogItems[i].price + '' + @@ -106,9 +121,15 @@ } function init() { - catalog.get(catalog_getResponse); - shoppingCart.get("", shoppingCart_getResponse); - } + + try { + catalog.get(catalog_getResponse); + shoppingCart.get("", shoppingCart_getResponse); + } + catch(e){ + alert(e); + } + } -- cgit v1.2.3