1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.plugin.gift.net.event;
21
22 /***
23 * ErrorEvent
24 *
25 * @author <a href="mailto:tvanlessen@taval.de">Tammo van Lessen</a>
26 * @version CVS $Id: ErrorEvent.java,v 1.1 2003/10/05 00:20:32 squig Exp $
27 */
28 public class ErrorEvent extends Event {
29
30
31 private Exception e;
32 private String msg;
33
34
35
36 /***
37 * Constructor for ErrorEvent.
38 *
39 * @param msg Message
40 */
41 public ErrorEvent(String msg) {
42 super();
43 this.msg = msg;
44 this.e = null;
45 }
46
47 /***
48 * Creates a new ErrorEvent object.
49 *
50 * @param msg Message
51 * @param e Exception
52 */
53 public ErrorEvent(String msg, Exception e) {
54 super();
55 this.msg = msg;
56 this.e = e;
57 }
58
59 /***
60 * Creates a new ErrorEvent object.
61 *
62 * @param e Exception
63 */
64 public ErrorEvent(Exception e) {
65 super();
66 this.msg = null;
67 this.e = e;
68 }
69
70
71
72 /***
73 * Returns the msg.
74 *
75 * @return String
76 */
77 public String getErrorMessage() {
78 return msg;
79 }
80
81 /***
82 * Returns the exception.
83 *
84 * @return Exception
85 */
86 public Exception getException() {
87 return e;
88 }
89
90 /***
91 * @see java.lang.Object#toString()
92 */
93 public String toString() {
94 return "Network Error (" + getErrorMessage() + ")";
95 }
96 }