summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/trunk/tutorials/travelsample/launchers
diff options
context:
space:
mode:
authormcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68>2010-09-01 20:13:53 +0000
committermcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68>2010-09-01 20:13:53 +0000
commit8e1916a350d18b773840fb64fd3e68969baca7ca (patch)
tree4a83995db289a50715dac6109edae4ff4e415e6a /sca-java-1.x/trunk/tutorials/travelsample/launchers
parent25d73a00fb7f94de99af7f3c1fed63b983678418 (diff)
Added better error handling for when the user forgets to run the service/smsgateway-jaxws project first
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@991683 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/trunk/tutorials/travelsample/launchers')
-rw-r--r--sca-java-1.x/trunk/tutorials/travelsample/launchers/notification-ws/src/main/java/scatours/NotificationWSLauncher.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/sca-java-1.x/trunk/tutorials/travelsample/launchers/notification-ws/src/main/java/scatours/NotificationWSLauncher.java b/sca-java-1.x/trunk/tutorials/travelsample/launchers/notification-ws/src/main/java/scatours/NotificationWSLauncher.java
index fbdb1500f5..e29d194a46 100644
--- a/sca-java-1.x/trunk/tutorials/travelsample/launchers/notification-ws/src/main/java/scatours/NotificationWSLauncher.java
+++ b/sca-java-1.x/trunk/tutorials/travelsample/launchers/notification-ws/src/main/java/scatours/NotificationWSLauncher.java
@@ -25,6 +25,7 @@ import org.apache.tuscany.sca.node.SCAClient;
import org.apache.tuscany.sca.node.SCAContribution;
import org.apache.tuscany.sca.node.SCANode;
import org.apache.tuscany.sca.node.SCANodeFactory;
+import org.osoa.sca.ServiceRuntimeException;
import scatours.notification.Notification;
@@ -45,7 +46,15 @@ public class NotificationWSLauncher {
String accountID = "1234";
String subject = "Holiday payment taken";
String message = "Payment of £102.37 accepted...";
- notification.notify(accountID, subject, message);
+ try {
+ notification.notify(accountID, subject, message);
+ } catch (ServiceRuntimeException ex) {
+ System.out.println("========================= Error =========================");
+ System.out.println("Failed to call notification service.");
+ System.out.println("Did you remember to start it using the launcher in the services/smsgateway-jaxws project?");
+ System.out.println("========================= Error =========================");
+ System.exit(-1);
+ }
System.out.println("Node started - Press enter to shutdown.");
System.in.read();