如何在 Google Chrome Canary 中打开暂停未捕获的异常? [英] How to turn on Pause On Uncaught Exceptions in Google Chrome Canary?

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

问题描述

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

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

我只能在 Chrome 和 Canary 中看到 Pause On Caught Exceptions.我使用的是 Chrome Canary 版本 43.0.2344.2 Canary(64 位).

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).

我收到一个 Uncaught SyntaxError: Unexpected token :, source to a location (e.g. VM272) 并且很难在没有调用堆栈的情况下进行追踪.

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;}

在控制台中,但这并没有让我获得堆栈跟踪.Scope 窗口确实提供了很多变量信息,但我还是有点不知所措.

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.

推荐答案

文档有点过时了.

在新的 Chrome 版本中,异常暂停"按钮不再在 3 种状态(禁用异常暂停"、未捕获异常时暂停"),但仅限于两种状态(禁用异常时暂停").

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").

为了也能够中断捕获的异常,他们引入了这个复选框(如果您在 GWT 中有全局异常处理程序但仍然想中断抛出异常时).

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天全站免登陆