Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SerializableThrowable does not handle suppressed exceptions #9930

Open
jnehlmeier opened this issue Feb 26, 2024 · 0 comments
Open

SerializableThrowable does not handle suppressed exceptions #9930

jnehlmeier opened this issue Feb 26, 2024 · 0 comments

Comments

@jnehlmeier
Copy link
Member

GWT version: head


Description

GWT supports suppressed exceptions and also uses them internally in UmbrellaException. Sending exceptions containing suppressed exceptions to the server for remote logging using SerializableThrowable + GWT-RPC + StackTraceDeobfuscator will omit these exceptions, effectively loosing valuable information.

Steps to reproduce
var cause1 = new RuntimeException("cause 1");
cause1.addSuppressed(new RuntimeException("suppressed 1"));

var cause2 = new RuntimeException("cause 2");
cause2.addSuppressed(new RuntimeException("suppressed 2"));

var cause3 = new RuntimeException("cause 3");
cause3.addSuppressed(new RuntimeException("suppressed 3"));

var causes = new HashSet<Throwable>();
causes.add(cause1);
causes.add(cause2);
causes.add(cause3);

var umbrella = new UmbrellaException(causes);
umbrella.addSuppressed(new RuntimeException("suppressed 4"));

throw umbrella;

The above will loose cause2 and cause3 chain as well as suppressed 1 and suppressed 4.

Known workarounds

Build your own serializable throwable wrapper class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant