diff --git a/src/java/com/threerings/presents/server/ServiceFailedException.java b/src/java/com/threerings/presents/server/ServiceFailedException.java new file mode 100644 index 000000000..05e39741c --- /dev/null +++ b/src/java/com/threerings/presents/server/ServiceFailedException.java @@ -0,0 +1,45 @@ +// +// $Id: ServiceFailedException.java,v 1.1 2001/10/01 23:06:23 mdb Exp $ + +package com.threerings.cocktail.cher.server; + +/** + * An exception class for use in concert with invocation services when + * they need to communicate a failure of some kind and can't use the + * return value. + * + *
For example, consider an invitation service: + * + *
+ * public class fooManager
+ * {
+ * // returns invitation id, throws ServiceFailedException if
+ * // invitation couldn't be processed
+ * public int invite (...)
+ * throws ServiceFailedException
+ * {
+ * }
+ * }
+ *
+ * public class fooProvider
+ * {
+ * public void handleInviteRequest (...)
+ * {
+ * try {
+ * int inviteId = _mgr.invite(...);
+ * sendResponse(..., INVITE_RECEIVED, new Integer(inviteId));
+ *
+ * } catch (ServiceFailedException sfe) {
+ * sendResponse(..., INVITE_FAILED, sfe.getMessage());
+ * }
+ * }
+ * }
+ *
+ */
+public class ServiceFailedException extends Exception
+{
+ public ServiceFailedException (String message)
+ {
+ super(message);
+ }
+}