From 3898602f0e133135d63e2ce9d6ce131103bda99c Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 29 Jun 2018 09:22:29 -0400 Subject: [PATCH] Improved error logging of remote reading/writing --- .../src/io/anuke/annotations/RemoteReadGenerator.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/annotations/src/io/anuke/annotations/RemoteReadGenerator.java b/annotations/src/io/anuke/annotations/RemoteReadGenerator.java index 04bea2d2a4..a089619d89 100644 --- a/annotations/src/io/anuke/annotations/RemoteReadGenerator.java +++ b/annotations/src/io/anuke/annotations/RemoteReadGenerator.java @@ -63,6 +63,8 @@ public class RemoteReadGenerator { readBlock.nextControlFlow("else if(id == " + entry.id + ")"); } + readBlock.beginControlFlow("try"); + //concatenated list of variable names for method invocation StringBuilder varResult = new StringBuilder(); @@ -118,6 +120,9 @@ public class RemoteReadGenerator { "__forward(player.clientid" + (varResult.length() == 0 ? "" : ", ") + varResult.toString() + ")"); } + readBlock.nextControlFlow("catch (java.lang.Exception e)"); + readBlock.addStatement("throw new java.lang.RuntimeException(\"Failed to to read remote method '"+entry.element.getSimpleName() +"'!\", e)"); + readBlock.endControlFlow(); } //end control flow if necessary