Skip to content

Commit 6f7f8e4

Browse files
committed
added region selector
1 parent d151786 commit 6f7f8e4

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>me.kodysimpson</groupId>
88
<artifactId>SimpAPI</artifactId>
9-
<version>4.5.4</version>
9+
<version>4.5.5</version>
1010
<packaging>jar</packaging>
1111

1212
<name>SimpAPI</name>
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
package me.kodysimpson.simpapi.exceptions;
22

3-
43
public class MenuManagerException extends Exception {
54

5+
public MenuManagerException() {
6+
super();
7+
}
8+
9+
public MenuManagerException(String message) {
10+
super(message);
11+
}
12+
13+
public MenuManagerException(String message, Throwable cause) {
14+
super(message, cause);
15+
}
616

7-
}
17+
public MenuManagerException(Throwable cause) {
18+
super(cause);
19+
}
20+
}

src/main/java/me/kodysimpson/simpapi/menu/MenuManager.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,14 @@ public static void setup(Server server, Plugin plugin) {
5454
public static void openMenu(Class<? extends Menu> menuClass, Player player) throws MenuManagerException, MenuManagerNotSetupException {
5555
try {
5656
menuClass.getConstructor(PlayerMenuUtility.class).newInstance(getPlayerMenuUtility(player)).open();
57-
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
58-
throw new MenuManagerException();
57+
} catch (InstantiationException e) {
58+
throw new MenuManagerException("Failed to instantiate menu class", e);
59+
} catch (IllegalAccessException e) {
60+
throw new MenuManagerException("Illegal access while trying to instantiate menu class", e);
61+
} catch (InvocationTargetException e) {
62+
throw new MenuManagerException("An error occurred while trying to invoke the menu class constructor", e);
63+
} catch (NoSuchMethodException e) {
64+
throw new MenuManagerException("The menu class constructor could not be found", e);
5965
}
6066
}
6167

0 commit comments

Comments
 (0)