我最近开始使用gwt-log。
我按照入门教程并按照建议在我的初始化文件中添加了Log.setUncaughtExceptionHandler()
,但是当它存在时,我在chrome控制台中使用super dev模式获得此异常:
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
...
这是预期的行为,还是我不做我应该做的事情?