use of com.taobao.weex.common.WXJSExceptionInfo in project weex-example by KalicyZhou.
the class WXBridgeManager method reportJSException.
/**
* 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());
}
}
}
}
Aggregations