Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package org.bukkit.plugin;
2
3/**
4 * Thrown when attempting to load an invalid Plugin file
5 */
6public class UnknownDependencyException extends Exception {
7
8 private static final long serialVersionUID = 5721389371901775894L;
9 private final Throwable cause;
10 private final String message;
11
12 /**
13 * Constructs a new UnknownDependencyException based on the given Exception
14 *
15 * @param throwable Exception that triggered this Exception
16 */
17 public UnknownDependencyException(Throwable throwable) {
18 this(throwable, "Unknown dependency");
19 }
20
21 /**
22 * Constructs a new UnknownDependencyException with the given message
23 *
24 * @param message Brief message explaining the cause of the exception
25 */
26 public UnknownDependencyException(final String message) {
27 this(null, message);
28 }
29
30 /**
31 * Constructs a new UnknownDependencyException based on the given Exception
32 *
33 * @param message Brief message explaining the cause of the exception
34 * @param throwable Exception that triggered this Exception
35 */
36 public UnknownDependencyException(final Throwable throwable, final String message) {
37 this.cause = null;
38 this.message = message;
39 }
40
41 /**
42 * Constructs a new UnknownDependencyException
43 */
44 public UnknownDependencyException() {
45 this(null, "Unknown dependency");
46 }
47
48 /**
49 * If applicable, returns the Exception that triggered this Exception
50 *
51 * @return Inner exception, or null if one does not exist
52 */
53 @Override
54 public Throwable getCause() {
55 return cause;
56 }
57
58 @Override
59 public String getMessage() {
60 return message;
61 }
62}