Add global try/catch to JavaScript

后端 未结 2 729
我寻月下人不归
我寻月下人不归 2020-12-14 07:37

Is there some way to wrap the entire page in a try/catch, so that I can catch any error from any script that is executing?

2条回答
  •  醉话见心
    2020-12-14 08:09

    Turn on the debugger and break on error.

    You don't want to catch every error in the entire page on production code. That's horrible.

提交回复
热议问题