- Rethrow exception that caused the error, not just the invoking exception

This commit is contained in:
Sol
2017-03-04 19:10:12 +00:00
parent 2dea1dddc1
commit 56cdfaffa0

View File

@@ -56,7 +56,7 @@ public abstract class GameProtocolHandler<T> extends ChannelInboundHandlerAdapte
} catch (final IllegalAccessException | IllegalArgumentException e) { } catch (final IllegalAccessException | IllegalArgumentException e) {
System.err.println(String.format("Unknown protocol method %s with %d args", methodName, args == null ? 0 : args.length)); System.err.println(String.format("Unknown protocol method %s with %d args", methodName, args == null ? 0 : args.length));
} catch (final InvocationTargetException e) { } catch (final InvocationTargetException e) {
throw new RuntimeException(e); throw new RuntimeException(e.getTargetException());
} }
} else { } else {
Serializable reply = null; Serializable reply = null;
@@ -71,7 +71,7 @@ public abstract class GameProtocolHandler<T> extends ChannelInboundHandlerAdapte
} catch (final IllegalAccessException | IllegalArgumentException e) { } 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)); 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) { } catch (final InvocationTargetException e) {
throw new RuntimeException(e); throw new RuntimeException(e.getTargetException());
} }
getRemote(ctx).send(new ReplyEvent(event.getId(), reply)); getRemote(ctx).send(new ReplyEvent(event.getId(), reply));
} }