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