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

Commit

Permalink
eagle should degree err code fixup (#2426)
Browse files Browse the repository at this point in the history
* [data-render] add WX_RENDER_ERR_EAGLE_CREATE_PAGE err code
  • Loading branch information
hpop1994 authored and YorkShen committed May 9, 2019
1 parent b5dd77c commit 1349d21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2391,7 +2391,7 @@ public void reportJSException(String instanceId, String function,
if (instanceId != null && (instance = WXSDKManager.getInstance().getSDKInstance(instanceId)) != null) {
instance.setHasException(true);
exception += "\n getTemplateInfo==" +instance.getTemplateInfo();//add network header info
if ((METHOD_CREATE_INSTANCE.equals(function) || METHOD_UPDATE_COMPONENT_WITH_DATA.equals(function) || METHOD_CREATE_PAGE_WITH_CONTENT.equals(function)) || !instance.isContentMd5Match()) {
if ((METHOD_CREATE_INSTANCE.equals(function)) || !instance.isContentMd5Match()) {
try {
//data render mode should report exception instead of reload page,
// so we use !isSkipFrameworkInit(instanceId) to skip the positive branch of if clause.
Expand All @@ -2400,32 +2400,20 @@ public void reportJSException(String instanceId, String function,
instance.setNeedLoad(true);
return;
} else {
WXErrorCode degreeErrorCode;
if(TextUtils.equals(function, METHOD_CREATE_PAGE_WITH_CONTENT) || TextUtils.equals(function, METHOD_UPDATE_COMPONENT_WITH_DATA)){
degreeErrorCode = WXErrorCode.WX_DEGRAD_EAGLE_RENDER_ERROR;
} else {
degreeErrorCode = WXErrorCode.WX_DEGRAD_ERR_INSTANCE_CREATE_FAILED;
}
String errorMsg = new StringBuilder()
.append(degreeErrorCode.getErrorMsg())
.append(WXErrorCode.WX_DEGRAD_ERR_INSTANCE_CREATE_FAILED.getErrorMsg())
.append(", reportJSException >>>> instanceId:").append(instanceId)
.append(", exception function:").append(function)
.append(", exception:").append(exception)
.append(", extInitTime:").append(System.currentTimeMillis()-WXBridgeManager.sInitFrameWorkTimeOrigin).append("ms")
.append(", extInitErrorMsg:").append(WXBridgeManager.sInitFrameWorkMsg.toString())
.toString();
instance.onRenderError(//DegradPassivity to H5
degreeErrorCode.getErrorCode(),
WXErrorCode.WX_DEGRAD_ERR_INSTANCE_CREATE_FAILED.getErrorCode(),
errorMsg
);
if (!WXEnvironment.sInAliWeex){
WXErrorCode errCode;
if (METHOD_CREATE_INSTANCE.equals(function)){
errCode = WXErrorCode.WX_RENDER_ERR_JS_CREATE_INSTANCE;
} else {
errCode = WXErrorCode.WX_DEGRAD_EAGLE_RENDER_ERROR;
}
WXExceptionUtils.commitCriticalExceptionRT(instanceId,errCode,function,exception,null);
WXExceptionUtils.commitCriticalExceptionRT(instanceId, WXErrorCode.WX_RENDER_ERR_JS_CREATE_INSTANCE, function,exception,null);
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ public enum WXErrorCode {
WX_RENDER_ERR_LIST_INVALID_COLUMN_COUNT("-9619", "WX_RENDER_ERR_LIST_INVALID_COLUMNJ_CONUNT", ErrorType.JS_ERROR, ErrorGroup.JS),
WX_RENDER_ERR_TEXTURE_SETBACKGROUND("-9620", "WX_RENDER_ERR_TEXTURE_SETBACKGROUND", ErrorType.NATIVE_ERROR, ErrorGroup.NATIVE),


WX_KEY_EXCEPTION_NO_BUNDLE_TYPE("-9801", "Fatal Error : No bundle type in js bundle head, cause white screen or memory leak!!", ErrorType.JS_ERROR, ErrorGroup.JS),
/**
* degrade code.
Expand Down

0 comments on commit 1349d21

Please sign in to comment.