简体   繁体   English

为noSuchMethod Exception Dart获取行高亮显示(或至少进行堆栈跟踪)

[英]Get Line Highlighting (or at Least a Stack Trace) for noSuchMethod Exception Dart

I'm using Dart Editor. 我正在使用Dart编辑器。 When I accidently call a method on null, or trigger any other very common runtime error, I'd like the IDE to tell me where the exception came from. 当我不小心将方法调用为null或触发任何其他非常常见的运行时错误时,我希望IDE告诉我异常的来源。 Instead it just tells me the name of the method, the arguments and the receiver of the call. 相反,它只是告诉我方法的名称,参数和调用的接收者。

I end up having to step through the program from the entrypoint, see where it falls off, and then make a forensic guess of what might have thrown the exception. 最后,我不得不从入口点开始逐步执​​行该程序,查看程序出现的地方,然后对可能引发异常的原因进行法医猜测。

Is there a setting that's wrong? 是否存在错误的设置? I'm used to having my IDE take me right to the offending line, or getting a stacktrace in the console. 我习惯于让我的IDE直接进入有问题的行,或者在控制台中获取stacktrace。 Hunting for errors eats up a lot more time. 寻找错误会浪费更多时间。 How can I get the info I need? 如何获得所需的信息?

In Tools > Preferences > Run and Debug you can change the policy for Breaking on exceptions . 在“ 工具” > “首选项” > “运行和调试”中,您可以更改“ 打破例外 ”策略。 By selecting all the editor will break on every exceptions and you will be able to see stacktraces in the debugger panel. 通过选择所有编辑器,所有异常将中断,您将能够在调试器面板中看到堆栈跟踪。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM