本文整理汇总了Java中com.taobao.weex.WXSDKInstance.onJSException方法的典型用法代码示例。如果您正苦于以下问题:Java WXSDKInstance.onJSException方法的具体用法?Java WXSDKInstance.onJSException怎么用?Java WXSDKInstance.onJSException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.taobao.weex.WXSDKInstance
的用法示例。
在下文中一共展示了WXSDKInstance.onJSException方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reportJSException
import com.taobao.weex.WXSDKInstance; //导入方法依赖的package包/类
/**
* Report JavaScript Exception
*/
public void reportJSException(String instanceId, String function,
String exception) {
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.e("reportJSException >>>> instanceId:" + instanceId
+ ", exception function:" + function + ", exception:"
+ exception);
}
StringBuilder errorMsg=new StringBuilder();
WXSDKInstance instance = WXSDKManager.getInstance().getSDKInstance(instanceId);
if (instance != null) {
// TODO add errCode
instance.onJSException(null, function, exception);
errorMsg.append("bundleUrl:"+instance.getBundleUrl());
}else{
errorMsg.append(" bundleUrl:instance is null!");
}
errorMsg.append(" exception function:"+function);
errorMsg.append(" exception:"+exception);
WXErrorCode.WX_ERR_JS_EXECUTE.appendErrMsg(errorMsg.toString());
commitJSBridgeAlarmMonitor(instanceId,WXErrorCode.WX_ERR_JS_EXECUTE);
}
示例2: reportJSException
import com.taobao.weex.WXSDKInstance; //导入方法依赖的package包/类
/**
* Report JavaScript Exception
*/
public void reportJSException(String instanceId, String function,
String exception) {
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.e("reportJSException >>>> instanceId:" + instanceId
+ ", exception function:" + function + ", exception:"
+ exception);
}
WXSDKInstance instance;
if (instanceId != null && (instance = WXSDKManager.getInstance().getSDKInstance(instanceId)) != null) {
instance.onJSException(WXErrorCode.WX_ERR_JS_EXECUTE.getErrorCode(), function, exception);
String err = "function:" + function + "#exception:" + exception;
commitJSBridgeAlarmMonitor(instanceId, WXErrorCode.WX_ERR_JS_EXECUTE, err);
IWXJSExceptionAdapter adapter = WXSDKManager.getInstance().getIWXJSExceptionAdapter();
if (adapter != null) {
WXJSExceptionInfo jsException = new WXJSExceptionInfo(instanceId, instance.getBundleUrl(), WXErrorCode.WX_ERR_JS_EXECUTE.getErrorCode(), function, exception, null);
adapter.onJSException(jsException);
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.d(jsException.toString());
}
}
}
}
示例3: reportJSException
import com.taobao.weex.WXSDKInstance; //导入方法依赖的package包/类
/**
* Report JavaScript Exception
*/
public void reportJSException(String instanceId, String function,
String exception) {
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.e("reportJSException >>>> instanceId:" + instanceId
+ ", exception function:" + function + ", exception:"
+ exception);
}
WXSDKInstance instance;
if (instanceId != null && (instance = WXSDKManager.getInstance().getSDKInstance(instanceId)) != null) {
// TODO add errCode
instance.onJSException(null, function, exception);
String err="function:"+function+"#exception:"+exception;
commitJSBridgeAlarmMonitor(instanceId,WXErrorCode.WX_ERR_JS_EXECUTE,err);
}
}