Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package org.bukkit.event;
2
3public class EventException extends Exception {
4 private static final long serialVersionUID = 3532808232324183999L;
5 private final Throwable cause;
6
7 /**
8 * Constructs a new EventException based on the given Exception
9 *
10 * @param throwable Exception that triggered this Exception
11 */
12 public EventException(Throwable throwable) {
13 cause = throwable;
14 }
15
16 /**
17 * Constructs a new EventException
18 */
19 public EventException() {
20 cause = null;
21 }
22
23 /**
24 * Constructs a new EventException with the given message
25 */
26 public EventException(Throwable cause, String message) {
27 super(message);
28 this.cause = cause;
29 }
30
31 /**
32 * Constructs a new EventException with the given message
33 */
34 public EventException(String message) {
35 super(message);
36 cause = null;
37 }
38
39 /**
40 * If applicable, returns the Exception that triggered this Exception
41 *
42 * @return Inner exception, or null if one does not exist
43 */
44 @Override
45 public Throwable getCause() {
46 return cause;
47 }
48}