From 56cdfaffa007756cc73aaf2080071e81bdd0806a Mon Sep 17 00:00:00 2001 From: Sol Date: Sat, 4 Mar 2017 19:10:12 +0000 Subject: [PATCH] - Rethrow exception that caused the error, not just the invoking exception --- forge-gui/src/main/java/forge/net/GameProtocolHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forge-gui/src/main/java/forge/net/GameProtocolHandler.java b/forge-gui/src/main/java/forge/net/GameProtocolHandler.java index 888d0dffeed..face68c68ac 100644 --- a/forge-gui/src/main/java/forge/net/GameProtocolHandler.java +++ b/forge-gui/src/main/java/forge/net/GameProtocolHandler.java @@ -56,7 +56,7 @@ public abstract class GameProtocolHandler extends ChannelInboundHandlerAdapte } catch (final IllegalAccessException | IllegalArgumentException e) { System.err.println(String.format("Unknown protocol method %s with %d args", methodName, args == null ? 0 : args.length)); } catch (final InvocationTargetException e) { - throw new RuntimeException(e); + throw new RuntimeException(e.getTargetException()); } } else { Serializable reply = null; @@ -71,7 +71,7 @@ public abstract class GameProtocolHandler extends ChannelInboundHandlerAdapte } catch (final IllegalAccessException | IllegalArgumentException e) { System.err.println(String.format("Unknown protocol method %s with %d args, replying with null", methodName, args == null ? 0 : args.length)); } catch (final InvocationTargetException e) { - throw new RuntimeException(e); + throw new RuntimeException(e.getTargetException()); } getRemote(ctx).send(new ReplyEvent(event.getId(), reply)); }