Debugging in GWT Super Dev Mode?
Asked Answered
K

2

6

So far, debugging in GWT super dev mode seems to be a real pain. If there are any errors, there is no stack trace, just a cryptic message given in the chrome console. Is there a way to get all errors to print a stack trace, like in the dev mode?

I already have source maps on I believe, since if I go to Sources in Chrome's dev tools, I can see the source code of my java classes.

Kurtiskurtosis answered 25/5, 2014 at 0:23 Comment(4)
Hi, have you found a way to see java exception stack trace in superdev mode ?Farrell
@ice13ill No, the best i've found is to turn on source maps, and try to debug from chrome's console. If you set a watch / breakpoint in chrome's console, it will break at it and you could step through it.Kurtiskurtosis
Right, so that means that (if you have a big/complex code) you would have to somehow guess what variable could be problematic, and add a watch to it?Farrell
@ice13ill Actually, look at GWT.setUnhandledExceptionHandler. That will let you set the exception handler, and then you can print the stack trace of that exception to the console.Kurtiskurtosis
K
2

GWT.setUncaughtExceptionHandler lets you set an exception handler, which will handle all exceptions. You can then get the stacktrace of that exception using something like this code, and then print exception.toString() and the stack trace to the console. This has worked reasonably well for me.

Kurtiskurtosis answered 20/6, 2014 at 19:12 Comment(0)
L
0

How do you start super dev mode? From inside eclipse maybe? If you have a maven project and run it from the command line (e.g. mvn gwt:run) a window pops up showing you the stack traces of exceptions and other information as well.

Loredo answered 26/5, 2014 at 9:29 Comment(1)
I'm using Maven, with IntelliJ. That window only seems to show compile errors, not runtime errors..Kurtiskurtosis

© 2022 - 2024 — McMap. All rights reserved.