01: /*
02: * Copyright 2007 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.user.client.rpc;
17:
18: /**
19: * Superclass for exceptions thrown from RPC methods (those appearing in
20: * interfaces derived from {@link RemoteService}).
21: */
22: public class SerializableException extends Exception implements
23: IsSerializable {
24:
25: private String msg;
26:
27: /**
28: * The default constructor. This constructor is used implicitly during
29: * serialization or when constructing subclasses.
30: */
31: public SerializableException() {
32: }
33:
34: /**
35: * Constructs a serializable exception with the specified message. This
36: * constructor is most often called by subclass constructors.
37: */
38: public SerializableException(String msg) {
39: this .msg = msg;
40: }
41:
42: /**
43: * Exception chaining is not currently supported for serialized exceptions.
44: *
45: * @return always <code>null</code>
46: */
47: @Override
48: public Throwable getCause() {
49: return null;
50: }
51:
52: @Override
53: public String getMessage() {
54: return msg;
55: }
56:
57: /**
58: * No effect; exception chaining is not currently supported for serialized
59: * exceptions.
60: */
61: @Override
62: public Throwable initCause(Throwable cause) {
63: // nothing
64: return null;
65: }
66: }
|