File tree 2 files changed +12
-1
lines changed
src/main/java/at/jkvn/eventlib
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 5
5
import at .jkvn .eventlib .enumeration .EventPriority ;
6
6
import at .jkvn .eventlib .registry .Configuration ;
7
7
import at .jkvn .eventlib .registry .ListenerRegistryType ;
8
+ import at .jkvn .eventlib .exception .AutomaticListenerException ;
8
9
import lombok .Getter ;
9
10
import lombok .SneakyThrows ;
10
11
import org .reflections .Reflections ;
@@ -73,7 +74,7 @@ private static boolean isAutomatic() {
73
74
74
75
public static void registerListener (Listener listener ) throws Exception {
75
76
if (isAutomatic ()) {
76
- throw new Exception ("Cannot register listener on automatic mode" ); //Todo: create custom exception
77
+ throw new AutomaticListenerException ("Cannot register listener on automatic mode" );
77
78
}
78
79
listeners .add (listener );
79
80
}
Original file line number Diff line number Diff line change
1
+ package at .jkvn .eventlib .exception ;
2
+
3
+ import java .lang .String ;
4
+ import java .lang .Exception ;
5
+
6
+ public class AutomaticListenerException extends Exception {
7
+ public AutomaticListenerException (String message ) {
8
+ super (message );
9
+ }
10
+ }
You can’t perform that action at this time.
0 commit comments