From 8e1916a350d18b773840fb64fd3e68969baca7ca Mon Sep 17 00:00:00 2001 From: mcombellack Date: Wed, 1 Sep 2010 20:13:53 +0000 Subject: 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 --- .../src/main/java/scatours/NotificationWSLauncher.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sca-java-1.x/trunk/tutorials/travelsample') 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(); -- cgit v1.2.3