最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

debugging - How do I make the Internet Explorer Javascript debugger also pause on caught exceptions? - Stack Overflow

programmeradmin2浏览0评论

I am trying to debug a "property not found" exception that is only happening in IE. The bad part is that this exception is being caught and handled and I could only figure out how to make the IE 9 debugger pause on uncaught exceptions (Ctrl + Shift + E).

I can't temporarily remove the relevant try-catch clause without messing up my program logic and I'd rather not have to manually operate the debugger step-by-step. How can I easily find what line is generating my exception?

I am trying to debug a "property not found" exception that is only happening in IE. The bad part is that this exception is being caught and handled and I could only figure out how to make the IE 9 debugger pause on uncaught exceptions (Ctrl + Shift + E).

I can't temporarily remove the relevant try-catch clause without messing up my program logic and I'd rather not have to manually operate the debugger step-by-step. How can I easily find what line is generating my exception?

Share Improve this question asked Oct 17, 2011 at 17:48 hugomghugomg 70.1k29 gold badges166 silver badges255 bronze badges 6
  • might be better off debugging this in another browser with a better debugger (chrome, ff + firebug) ... of course the bug might not exist on other browsers – hunter Commented Oct 17, 2011 at 17:49
  • @hunter: The bug only surfaces in IE (why doesn't this surprise me?) – hugomg Commented Oct 17, 2011 at 17:53
  • are you using the debugger mand in your javascript? – hunter Commented Oct 17, 2011 at 17:54
  • Wouldn't using debugger still force me to manualy advance step-by-step though? I want to be able to instantly move to the next throw, just like I can in chrome. – hugomg Commented Oct 17, 2011 at 17:55
  • 1 The closest you are going to get with the IE JS debugger is setting a condition on your breakpoint. Hopefully that could get you closer. msdn.microsoft./en-us/library/dd565625(v=vs.85).aspx#_break – BNL Commented Oct 17, 2011 at 17:58
 |  Show 1 more ment

1 Answer 1

Reset to default 6

After a while I conclude that there sadly is no easy way to force IE to halt on caught exceptions.

By the way, I have since solved the problem that triggered this question. I was console.log-ing a XML document and unlike Chrome and FF, IE doesn't handle that well. This is particularly annoying since I was using console.log calls to help debug >_<

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论