Added a ServiceFailedException for use by invocation services.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@372 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-10-01 23:06:23 +00:00
parent 6d81a6e571
commit f54628c2ba
@@ -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.
*
* <p> For example, consider an invitation service:
*
* <pre>
* 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());
* }
* }
* }
* </pre>
*/
public class ServiceFailedException extends Exception
{
public ServiceFailedException (String message)
{
super(message);
}
}