summaryrefslogtreecommitdiffstats
path: root/java/sca/tutorial
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2008-07-17 00:36:25 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2008-07-17 00:36:25 +0000
commitd87b7a5e7430ab946c851208e45ddbf03330c98f (patch)
treea25d04d5dd5ba93de5b138164bb63a4528f07565 /java/sca/tutorial
parent3f56676b3bf9248726941f88018bf7b38db5e895 (diff)
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
Diffstat (limited to 'java/sca/tutorial')
-rw-r--r--java/sca/tutorial/assets/uiservices/store.html30
-rw-r--r--java/sca/tutorial/store-eu/uiservices/store-eu.html32
-rw-r--r--java/sca/tutorial/store-mashup/gadget/store-gadget.html30
3 files changed, 74 insertions, 18 deletions
diff --git a/java/sca/tutorial/assets/uiservices/store.html b/java/sca/tutorial/assets/uiservices/store.html
index 095570f949..f2425b4885 100644
--- a/java/sca/tutorial/assets/uiservices/store.html
+++ b/java/sca/tutorial/assets/uiservices/store.html
@@ -35,7 +35,11 @@
var catalogItems;
- function catalog_getResponse(items) {
+ function catalog_getResponse(items,exception) {
+ if(exception){
+ alert(exception.message);
+ return;
+ }
var catalog = "";
for (var i=0; i<items.length; i++) {
var item = items[i].name + ' - ' + items[i].price;
@@ -58,13 +62,22 @@
}
document.getElementById("shoppingCart").innerHTML = list;
- if (entries.length != 0) {
- shoppingTotal.getTotal(shoppingTotal_getTotalResponse);
+ if (entries.length != 0) {
+ try {
+ shoppingTotal.getTotal(shoppingTotal_getTotalResponse);
+ }
+ catch(e) {
+ alert(e);
+ }
}
}
}
- function shoppingTotal_getTotalResponse(total) {
+ function shoppingTotal_getTotalResponse(total,exception) {
+ if(exception){
+ alert(exception.message);
+ return;
+ }
document.getElementById('total').innerHTML = total;
}
@@ -106,8 +119,13 @@
}
function init() {
- catalog.get(catalog_getResponse);
- shoppingCart.get("", shoppingCart_getResponse);
+ try {
+ catalog.get(catalog_getResponse);
+ shoppingCart.get("", shoppingCart_getResponse);
+ }
+ catch(e) {
+ alert(e);
+ }
}
</script>
diff --git a/java/sca/tutorial/store-eu/uiservices/store-eu.html b/java/sca/tutorial/store-eu/uiservices/store-eu.html
index ec72d9b2a7..4569b76b3f 100644
--- a/java/sca/tutorial/store-eu/uiservices/store-eu.html
+++ b/java/sca/tutorial/store-eu/uiservices/store-eu.html
@@ -35,7 +35,11 @@
var catalogItems;
- function catalog_getResponse(items) {
+ function catalog_getResponse(items, exception) {
+ if(exception){
+ alert(exception.message);
+ return;
+ }
var catalog = "";
for (var i=0; i<items.length; i++) {
var item = items[i].name + ' - ' + items[i].price;
@@ -58,13 +62,23 @@
}
document.getElementById("shoppingCart").innerHTML = list;
- if (entries.length != 0) {
- shoppingTotal.getTotal(shoppingTotal_getTotalResponse);
+ if (entries.length != 0) {
+ try {
+ shoppingTotal.getTotal(shoppingTotal_getTotalResponse);
+ }
+ carch(e) {
+ alert(e);
+ }
+
}
}
}
- function shoppingTotal_getTotalResponse(total) {
+ function shoppingTotal_getTotalResponse(total,exception) {
+ if(exception){
+ alert(exception.message);
+ return;
+ }
document.getElementById('total').innerHTML = total;
}
@@ -106,8 +120,14 @@
}
function init() {
- catalog.get(catalog_getResponse);
- shoppingCart.get("", shoppingCart_getResponse);
+ try {
+ catalog.get(catalog_getResponse);
+ shoppingCart.get("", shoppingCart_getResponse);
+ }
+ catch(e) {
+ alert(e);
+ }
+
}
</script>
diff --git a/java/sca/tutorial/store-mashup/gadget/store-gadget.html b/java/sca/tutorial/store-mashup/gadget/store-gadget.html
index c2a8ba5118..c09b9d28c8 100644
--- a/java/sca/tutorial/store-mashup/gadget/store-gadget.html
+++ b/java/sca/tutorial/store-mashup/gadget/store-gadget.html
@@ -35,7 +35,11 @@
var catalogItems;
- function catalog_getResponse(items) {
+ function catalog_getResponse(items,exception) {
+ if(exception){
+ alert(exception.message);
+ return;
+ }
var catalog = "";
for (var i=0; i<items.length; i++) {
var item = items[i].name + ' - ' + items[i].price;
@@ -58,13 +62,22 @@
}
document.getElementById("shoppingCart").innerHTML = list;
- if (entries.length != 0) {
- shoppingTotal.getTotal(shoppingTotal_getTotalResponse);
+ if (entries.length != 0) {
+ try {
+ shoppingTotal.getTotal(shoppingTotal_getTotalResponse);
+ }
+ carch(e) {
+ alert(e);
+ }
}
}
}
- function shoppingTotal_getTotalResponse(total) {
+ function shoppingTotal_getTotalResponse(total,exception) {
+ if(exception){
+ alert(exception.message);
+ return;
+ }
document.getElementById('total').innerHTML = total;
}
@@ -113,8 +126,13 @@
}
function init() {
- catalog.get(catalog_getResponse);
- shoppingCart.get("", shoppingCart_getResponse);
+ try {
+ catalog.get(catalog_getResponse);
+ shoppingCart.get("", shoppingCart_getResponse);
+ }
+ catch(e) {
+ alert(e);
+ }
}
</script>