在 GWT 超级开发模式下调试? [英] Debugging in GWT Super Dev Mode?

查看:33
本文介绍了在 GWT 超级开发模式下调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,在 GWT 超级开发模式下调试似乎真的很痛苦.如果有任何错误,则没有堆栈跟踪,只有 chrome 控制台中给出的一条神秘消息.有没有办法让所有错误打印堆栈跟踪,就像在开发模式下一样?

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?

我相信我已经有了源映射,因为如果我在 Chrome 的开发工具中访问源,我可以看到我的 java 类的源代码.

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.

推荐答案

GWT.setUncaughtExceptionHandler 允许您设置一个异常处理程序,它将处理所有异常.然后,您可以使用类似 此代码 的内容获取该异常的堆栈跟踪,然后打印 exception.toString() 和到控制台的堆栈跟踪.这对我来说效果很好.

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.

这篇关于在 GWT 超级开发模式下调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆