diff --git a/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java b/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java index 2c01bcd005..ee93d96369 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java @@ -8,8 +8,10 @@ import com.fanruan.carina.annotions.Stop; import com.fanruan.carina.annotions.Supplemental; import com.fanruan.plugin.autonomy.AutonomyClassManagerGroup; import com.fanruan.workplace.conetxt.CompatiblePool; +import com.fanruan.workplace.http.HttpConstants; import com.fanruan.workplace.http.RepositoryManager; import com.fanruan.workplace.http.WorkspaceHeartBeatShell; +import com.fanruan.workplace.http.exception.RemoteExceptionConvert; import com.fanruan.workplace.standard.ServerInfo; import com.fanruan.workplace.standard.ServerInfoOperator; import com.fr.base.io.FileAssistUtils; @@ -41,6 +43,10 @@ import com.fr.workspace.engine.FineWorkspaceFactory; import com.fr.workspace.engine.base.FineObjectPool; import com.fr.workspace.engine.client.heartbeart.FineWorkspaceHeartbeat; import com.fr.workspace.engine.client.heartbeart.WorkspaceHeartbeat; +import com.fr.workspace.engine.exception.RemoteDesignNoAuthException; +import com.fr.workspace.engine.exception.RemoteDesignPasswordNeedUpdateException; +import com.fr.workspace.engine.exception.RemoteDesignPasswordStrengthException; +import com.fr.workspace.engine.exception.RemoteDesignUserPwdErrorException; import com.fr.workspace.engine.resource.FineWorkResource; import com.fr.workspace.engine.resource.FineWorkResourceAdaptor; import com.fr.workspace.pool.WorkRPCRegister; @@ -111,6 +117,7 @@ public class DesignWorkContextComponent { WorkContext.setWorkResource(new FineWorkResourceAdaptor()); WorkContext.setVersion(VERSION_NUM + "#" + ServiceContext.group(WorkspaceKey.class).getAll().size()); + startErrorConvert(); } @@ -135,6 +142,15 @@ public class DesignWorkContextComponent { } } + + private void startErrorConvert() { + RemoteExceptionConvert.registerException(HttpConstants.USER_PWD_ERROR_CODE, new RemoteDesignUserPwdErrorException()); + RemoteExceptionConvert.registerException(HttpConstants.USER_PWD_NEED_UPDATE, new RemoteDesignPasswordNeedUpdateException()); + RemoteExceptionConvert.registerException(HttpConstants.PASSWORD_STRENGTH_ERROR_CODE, new RemoteDesignPasswordStrengthException()); + RemoteExceptionConvert.registerException(HttpConstants.REMOTE_AUTHORITY_ERROR_CODE, new RemoteDesignNoAuthException()); + RemoteExceptionConvert.registerException(HttpConstants.PASSWORD_EMPTY_ERROR_CODE, new RemoteDesignUserPwdErrorException()); + } + private void supplementalCommon() { Carina.getApplicationContext().singleton(WorkspaceHeartBeatShell.class).set(new FineWorkspaceHeartbeat()); Carina.getApplicationContext().group(WorkspaceKey.class).addAll(