Uncaught closure-persistence-abuse exception
LadyCailinBot opened this issue ยท 4 comments
CMDHELPER-2717 - Reported by opoq
Where /run $ = eval($)
18:27:56 [INFO] CH: Running original command on player opoq ----> /run store_value('test', json_encode(array(closure(msg('Hi!')))))
18:27:56 [INFO] An unexpected exception occured during the execution of a script.
18:27:56 [SEVERE] java.lang.Error: com.laytonsmith.core.exceptions.MarshalException: The type of CClosure is not currently supported: msg
18:27:56 [SEVERE] at com.laytonsmith.core.functions.DataTransformations$json_encode.exec(DataTransformations.java:61)
18:27:56 [SEVERE] at com.laytonsmith.core.Script.eval(Script.java:314)
18:27:56 [SEVERE] at com.laytonsmith.core.Script.eval(Script.java:275)
18:27:56 [SEVERE] at com.laytonsmith.core.Script.seval(Script.java:210)
18:27:56 [SEVERE] at com.laytonsmith.core.functions.Meta$eval.execs(Meta.java:395)
18:27:56 [SEVERE] at com.laytonsmith.core.Script.eval(Script.java:267)
18:27:56 [SEVERE] at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1489)
18:27:56 [SEVERE] at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1454)
18:27:56 [SEVERE] at com.laytonsmith.core.Script.run(Script.java:164)
18:27:56 [SEVERE] at com.laytonsmith.core.AliasCore.alias(AliasCore.java:137)
18:27:56 [SEVERE] at com.laytonsmith.commandhelper.CommandHelperListener.runAlias(CommandHelperListener.java:86)
18:27:56 [SEVERE] at com.laytonsmith.commandhelper.CommandHelperListener.onPlayerCommandPreprocess(CommandHelperListener.java:131)
18:27:56 [SEVERE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
18:27:56 [SEVERE] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
18:27:56 [SEVERE] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
18:27:56 [SEVERE] at java.lang.reflect.Method.invoke(Method.java:616)
18:27:56 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
18:27:56 [SEVERE] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
18:27:56 [SEVERE] at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:46)
18:27:56 [SEVERE] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:478)
18:27:56 [SEVERE] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:463)
18:27:56 [SEVERE] at net.minecraft.server.v1_5_R3.PlayerConnection.handleCommand(PlayerConnection.java:976)
18:27:56 [SEVERE] at net.minecraft.server.v1_5_R3.PlayerConnection.chat(PlayerConnection.java:901)
18:27:56 [SEVERE] at net.minecraft.server.v1_5_R3.PlayerConnection.a(PlayerConnection.java:846)
18:27:56 [SEVERE] at net.minecraft.server.v1_5_R3.Packet3Chat.handle(Packet3Chat.java:44)
18:27:56 [SEVERE] at org.spigotmc.netty.NettyNetworkManager.b(NettyNetworkManager.java:215)
18:27:56 [SEVERE] at net.minecraft.server.v1_5_R3.PlayerConnection.d(PlayerConnection.java:115)
18:27:56 [SEVERE] at net.minecraft.server.v1_5_R3.ServerConnection.b(SourceFile:35)
18:27:56 [SEVERE] at org.spigotmc.MultiplexingServerConnection.b(MultiplexingServerConnection.java:72)
18:27:56 [SEVERE] at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:583)
18:27:56 [SEVERE] at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:227)
18:27:56 [SEVERE] at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:472)
18:27:56 [SEVERE] at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:404)
18:27:56 [SEVERE] at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
18:27:56 [SEVERE] Caused by: com.laytonsmith.core.exceptions.MarshalException: The type of CClosure is not currently supported: msg
18:27:56 [SEVERE] at com.laytonsmith.core.constructs.Construct.json_encode0(Construct.java:168)
18:27:56 [SEVERE] at com.laytonsmith.core.constructs.Construct.json_encode0(Construct.java:157)
18:27:56 [SEVERE] at com.laytonsmith.core.constructs.Construct.json_encode(Construct.java:136)
18:27:56 [SEVERE] at com.laytonsmith.core.functions.DataTransformations$json_encode.exec(DataTransformations.java:58)
18:27:56 [SEVERE] ... 33 more
Comment by Tom.Gebbett
You cannot persist closures.
My solution in a system I created a while ago was to persist a procedure name (and some arguments) that could be called later.
Comment by opoq
Thanks - I'm aware of the limitation, I just submit these so LC can catch them properly.
Comment by Tom.Gebbett
ahh, i see. Usually trying to persist closures has thrown a CH exception for me, rather than the console stacktrace.