Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

[WEEX-570][Android] add ut details #1442

Merged
merged 1 commit into from
Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1923,8 +1923,11 @@ private void invokeRegisterModules(Map<String, Object> modules, List<Map<String,
}

WXJSObject[] args = {WXWsonJSONSwitch.toWsonOrJsonWXJSObject(modules)};
String errorMsg = null;
try {
mWXBridge.execJS("", null, METHOD_REGISTER_MODULES, args);
if(0 == mWXBridge.execJS("", null, METHOD_REGISTER_MODULES, args)) {
errorMsg = "execJS error";
}
try {
Iterator<String> iter = modules.keySet().iterator();
while (iter.hasNext()) {
Expand All @@ -1938,13 +1941,16 @@ private void invokeRegisterModules(Map<String, Object> modules, List<Map<String,
WXLogUtils.e("Weex [invokeRegisterModules]", e);
}
} catch (Throwable e) {
WXExceptionUtils.commitCriticalExceptionRT(null,
WXErrorCode.WX_KEY_EXCEPTION_INVOKE_REGISTER_MODULES,
"invokeRegisterModules", WXErrorCode.WX_KEY_EXCEPTION_INVOKE_REGISTER_MODULES.getErrorMsg() +
" \n " + e.getMessage() + modules.entrySet().toString(),
null );
errorMsg = WXErrorCode.WX_KEY_EXCEPTION_INVOKE_REGISTER_MODULES.getErrorMsg() +
" \n " + e.getMessage() + modules.entrySet().toString();
}

WXLogUtils.e("[WXBridgeManager] invokeRegisterModules:", e);
if(!TextUtils.isEmpty(errorMsg)) {
WXLogUtils.e("[WXBridgeManager] invokeRegisterModules:", errorMsg);
WXExceptionUtils.commitCriticalExceptionRT(null,
WXErrorCode.WX_KEY_EXCEPTION_INVOKE_REGISTER_MODULES,
"invokeRegisterModules", errorMsg,
null );
}
}

Expand All @@ -1965,17 +1971,23 @@ private void invokeRegisterComponents(List<Map<String, Object>> components, List
}

WXJSObject[] args = {WXWsonJSONSwitch.toWsonOrJsonWXJSObject(components)};
String errorMsg = null;
try {
mWXBridge.execJS("", null, METHOD_REGISTER_COMPONENTS, args);
if(0 == mWXBridge.execJS("", null, METHOD_REGISTER_COMPONENTS, args)) {
errorMsg = "execJS error";
}
} catch (Throwable e) {
WXLogUtils.e("[WXBridgeManager] invokeRegisterComponents ", e);
WXExceptionUtils.commitCriticalExceptionRT(null,
WXErrorCode.WX_KEY_EXCEPTION_INVOKE_REGISTER_CONTENT_FAILED,
METHOD_REGISTER_COMPONENTS,
WXErrorCode.WX_KEY_EXCEPTION_INVOKE_REGISTER_CONTENT_FAILED
+ args.toString()
+ WXLogUtils.getStackTrace(e),
null);
errorMsg = WXErrorCode.WX_KEY_EXCEPTION_INVOKE_REGISTER_COMPONENT
+ args.toString()
+ WXLogUtils.getStackTrace(e);
}

if(!TextUtils.isEmpty(errorMsg)) {
WXLogUtils.e("[WXBridgeManager] invokeRegisterComponents ", errorMsg);
WXExceptionUtils.commitCriticalExceptionRT(null,
WXErrorCode.WX_KEY_EXCEPTION_INVOKE_REGISTER_COMPONENT,
METHOD_REGISTER_COMPONENTS, errorMsg,
null);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public enum WXErrorCode {
WX_KEY_EXCEPTION_INVOKE_REGISTER_CONTENT_FAILED("-9101", "[WX_KEY_EXCEPTION_INVOKE_REGISTER_CONTENT_FAILED] details",ErrorType.NATIVE_ERROR,ErrorGroup.NATIVE),
WX_KEY_EXCEPTION_INVOKE_JSSERVICE_EXECUTE("-9102", "[WX_KEY_EXCEPTION_INVOKE_JSSERVICE_EXECUTE] details",ErrorType.NATIVE_ERROR,ErrorGroup.NATIVE),
WX_KEY_EXCEPTION_INVOKE_REGISTER_MODULES("-9103", "[WX_KEY_EXCEPTION_INVOKE_REGISTER_MODULES] details",ErrorType.NATIVE_ERROR,ErrorGroup.NATIVE),

WX_KEY_EXCEPTION_INVOKE_REGISTER_COMPONENT("-9104", "[WX_KEY_EXCEPTION_INVOKE_REGISTER_COMPONENT] details",ErrorType.NATIVE_ERROR,ErrorGroup.NATIVE),
/**
* WX Key Exception Commit Bundle Js Download
*/
Expand Down