001 /*
002 * Copyright 2006 Google Inc.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005 * use this file except in compliance with the License. You may obtain a copy of
006 * the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013 * License for the specific language governing permissions and limitations under
014 * the License.
015 */
016 package com.google.gwt.user.client.rpc;
017
018 /**
019 * Occurs when a service invocation did not complete cleanly.
020 * <p>
021 * A service invocation completes cleanly if
022 * <ol>
023 * <li>A response is returned from the service, or</li>
024 * <li>An exception generated within the service is successfully received and
025 * re-thrown in the client.</li>
026 * </ol>
027 * </p>
028 *
029 * <p>
030 * A service invocation can fail to complete cleanly for many reasons, including
031 * <ol>
032 * <li>The network connection to the server is unavailable</li>
033 * <li>The host web server is not available</li>
034 * <li>The server is not available</li>
035 * </ol>
036 * </p>
037 *
038 * <p>
039 * Note that it <em>is</em> possible for this exception to be thrown even if
040 * the service was invoked successfully on the server. This could be the case,
041 * for example, if a network failure happened after the invocation request was
042 * sent but before the response was received.
043 * </p>
044 */
045 public class InvocationException extends RuntimeException {
046
047 /**
048 * Constructs an exception with the given description.
049 *
050 * @param s the exception's description.
051 */
052 public InvocationException(String s) {
053 super(s, null);
054 }
055
056 /**
057 * Constructs an exception with the given description and cause.
058 *
059 * @param s the exception's description.
060 * @param cause the exception's cause.
061 */
062 public InvocationException(String s, Throwable cause) {
063 super(s, cause);
064 }
065 }