01: // ProtocolException.java
02: // $Id: ProtocolException.java,v 1.2 2000/08/16 21:37:53 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1996.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.tools.resources;
07:
08: public class ProtocolException extends Exception {
09: String msg = null;
10: ReplyInterface error = null;
11:
12: /**
13: * Was a reply provided with the exception ?
14: * @return True if a reply is available.
15: */
16:
17: public boolean hasReply() {
18: return error != null;
19: }
20:
21: /**
22: * Get this exception reply.
23: * @return The reply to send back to requesting process.
24: */
25:
26: public ReplyInterface getReply() {
27: return error;
28: }
29:
30: public ProtocolException(String msg) {
31: super (msg);
32: this .error = null;
33: }
34:
35: public ProtocolException(String msg, ReplyInterface error) {
36: super (msg);
37: this .error = error;
38: }
39:
40: public ProtocolException(ReplyInterface error) {
41: super ((String) null);
42: this.error = error;
43: }
44:
45: }
|