问题
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.
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/23850898/debugging-in-gwt-super-dev-mode