Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit dc6a9c0

Browse files
committed
Handle ScriptEngine exceptions in AnnotationProcessor
1 parent a522291 commit dc6a9c0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main/java/gg/nextforge/protocol/listener/AnnotationProcessor.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package gg.nextforge.protocol.listener;
22

33
import gg.nextforge.plugin.NextForgePlugin;
4+
import gg.nextforge.protocol.ScriptEngine;
45
import gg.nextforge.protocol.packet.PacketContainer;
56
import gg.nextforge.protocol.packet.PacketType;
67
import gg.nextforge.protocol.ProtocolManager;
@@ -149,7 +150,11 @@ private static class MethodPacketListener extends PacketListener {
149150
if (filter != null && !filter.isEmpty()) {
150151
this.filterName = "handler_" + method.getName() + "_" + System.nanoTime();
151152
var engine = NextForgePlugin.getInstance().getProtocolManager().getScriptEngine();
152-
engine.compileFilter(filterName, filter);
153+
try {
154+
engine.compileFilter(filterName, filter);
155+
} catch (ScriptEngine.ScriptException e) {
156+
throw new RuntimeException(e);
157+
}
153158
} else {
154159
this.filterName = null;
155160
}

0 commit comments

Comments
 (0)