Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/413.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript android webview js何时会捕获错误?_Javascript_Android_Logging_Android Webview_Bridge - Fatal编程技术网

Javascript android webview js何时会捕获错误?

Javascript android webview js何时会捕获错误?,javascript,android,logging,android-webview,bridge,Javascript,Android,Logging,Android Webview,Bridge,我在应用程序中创建了一个webview和一些js绑定。 出于安全原因,我将js桥函数包装在try catch中。 但是,我不知道js catch函数捕获了什么。 因为错误是随机发生的,所以我通过GA发送错误,但没有设置事件值 试试看{ price=JsBridge.getProductPriceString('something wrogn'); }捕获(e){ ga('send','event','Error','Exception',e&&e.toString()); log(“getPri

我在应用程序中创建了一个webview和一些js绑定。
出于安全原因,我将js桥函数包装在try catch中。
但是,我不知道js catch函数捕获了什么。 因为错误是随机发生的,所以我通过GA发送错误,但没有设置事件值

试试看{
price=JsBridge.getProductPriceString('something wrogn');
}捕获(e){
ga('send','event','Error','Exception',e&&e.toString());
log(“getPriceString”,e);
警报(“获取价格字符串错误:”,e);
}
我想我可以从Android java方面进行调查。

但我不知道Android js绑定何时会触发js捕获功能?

您可以像Android中通常使用的那样使用调试

Log.d(“标记”、“异常”)

如果您使用
alert
console.log
在Android中不直接工作