I have this code to handle uncaught exceptions with GWT:
GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
@Override
public void onUncaughtException(Throwable throwable) {
// Iterate over the trace and then print with $wnd.console.log
printStackTrace(throwable.getStackTrace());
}
});
However the log printed in the Browser console looks like this:
"Unknown.Ol(Unknown Source)
Unknown.Nl(Unknown Source)
Unknown.Vl(Unknown Source)
Unknown.Hu(Unknown Source)
Unknown.Ku(Unknown Source)
Unknown.ju(Unknown Source)
Unknown.h6(Unknown Source)
Unknown.As(Unknown Source)
Unknown.j6(Unknown Source)
Unknown.u6(Unknown Source)
Unknown.L3(Unknown Source)
Unknown.k5(Unknown Source)
Unknown.hn(Unknown Source)
Unknown.mn(Unknown Source)
Unknown.ln/<(Unknown Source)
Unknown.anonymous(Unknown Source)
How can I make this show the actual stack trace like the old GWT style?
This worked for me, keep in mind it's not perfect but it will give you the file and line numbers in your stack trace. Yes this works with gwt 2.7 and super dev mode. You need to add this to your *.gwt.xml file. You may want to turn this off for production because it adds quite a bit of code bloat but makes debugging much much simpler.
<set-property name="compiler.stackMode" value="emulated" />
<set-configuration-property name="compiler.emulatedStack.recordFileNames"
value="true" />
<set-configuration-property name="compiler.emulatedStack.recordLineNumbers"
value="true" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With