我最近开始使用gwt-log。
我按照入门教程并Log.setUncaughtExceptionHandler()
按照建议添加到我的初始化文件中,但是当它在那里时,我在 chrome 控制台中得到了这个异常(使用超级开发模式):
2014-07-31 15:16:21,025 [FATAL] Uncaught Exception:
com.google.gwt.core.client.JavaScriptException: (TypeError)
__gwt$exception: <skipped>: Cannot read property 'formatTotal' of null
at Unknown.$getTotal_1(project-0.js@33:126146)
at Unknown.$getFromModel_198(project-0.js@65:103988)
at Unknown.getFromModel_199(project-0.js@10:104011)
at Unknown.$visit(project-0.js@15:22142)
at Unknown.visit_3(project-0.js@10:22188)
at Unknown.$traverse(project-0.js@11:21813)
at Unknown.accept_73(project-0.js@33:103339)
at Unknown.$traverse(project-0.js@57:21813)
at Unknown.$traverse_0(project-0.js@13:21877)
at Unknown.attach(project-0.js@21:21903)
...
如您所见,很难调试,没有行号或指向 java 源的链接。当我注释掉该Log.setUncaughtExceptionHandler()
行时,我将源映射到这样的异常:
Uncaught TypeError: Cannot read property 'formatTotal' of null UnitRate.java:87
$getTotal_1 UnitRate.java:87
$getFromModel_198 UnitRateRenderer_total_Context.java:17
getFromModel_199 UnitRateRenderer_total_Context.java:16
$visit Refresher.java:30
visit_3 Initializer.java:49
$traverse AbstractEditorContext.java:128
accept_73 UnitRateRenderer_SimpleBeanEditorDelegate.java:57
$traverse AbstractEditorContext.java:129
$traverse_0 AbstractEditorDelegate.java:100
...
这是预期的行为还是我没有做我应该做的事情?