mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Rethrow exception that caused the error, not just the invoking exception
This commit is contained in:
@@ -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));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user