如何在Google Chrome Canary上打开暂停未捕获的例外情况? [英] How to turn on Pause On Uncaught Exceptions in Google Chrome Canary?

查看:152
本文介绍了如何在Google Chrome Canary上打开暂停未捕获的例外情况?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这篇文章中,它讨论了如何暂停未捕获的异常。
https://developer.chrome.com/devtools/docs/javascript-debugging



我只能在Chrome和Canary中看到捕捉异常暂停。我正在使用Chrome Canary版本43.0.2344.2 canary(64位)。




我搜索了一下,发现我可以添加

 > window.onerror = function(){debugger;} 

在控制台中,但没有得到我堆栈跟踪。范围窗口确实提供了很多变量信息,但我仍然有点遗失。



解决方案

docuemntation有些过时。



在新的Chrome版本中,停用例外按钮在3种状态(禁用暂停(禁用暂停在例外之上)) 。为了能够打破捕获的异常,他们引入了这个复选框(如果您在 中有一个全局异常处理程序, code> GWT ,但在引发异常时仍然需要中断)。所以如果你没有发现异常,您在屏幕截图中显示的设置应该有效。

In this article it talks about turning on pausing on uncaught exceptions. https://developer.chrome.com/devtools/docs/javascript-debugging

I can only see Pause On Caught Exceptions in both Chrome and Canary. I'm using Chrome Canary Version 43.0.2344.2 canary (64-bit).

I'm getting a Uncaught SyntaxError: Unexpected token :, sourcing to a location (e.g. VM272) and it's very difficult to track down without a trace of the call stack.

I've searched and found that I can add

> window.onerror = function() { debugger;}

In the console, but that doesn't get me a stack trace. The Scope window does provide a lot of variable info, but I'm still a bit lost.

解决方案

The docuemntation is a little bit outdated.

In the new Chrome versions the "pause on exception" button doesn't toggle anymore between 3 states (disabled, "Pause on Exceptions","Pause on Uncaught Exceptions") but only between two states (disabled and "Pause on Exception").

In order to be able to also break on caught exceptions they introduced this checkbox (this is useful if you have a global exception handler in GWT but still want to break when the exception is thrown).

So if you don't catch the exception then the settings you have shown in your screenshot should work.

这篇关于如何在Google Chrome Canary上打开暂停未捕获的例外情况?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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