yuxc
2024-06-24 ee0184ce1d8a91e297fdd3d3582f2f39977bd64f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.vci.server.workflow.server;
 
 
import com.vci.common.exception.VciExceptionTool;
import com.vci.corba.common.VCIError;
import com.vci.server.base.exception.ExceptionLocalHandler;
 
public class ServerErrorTool {
    public static VCIError getVCIError(String key, Throwable e){
        VCIError error = null;
        if (e == null) {
            error = new VCIError(key, new String[0]);
        } else if (e instanceof VCIError) {
            error = (VCIError) e;
        } else {
            error = new VCIError(key, new String[]{VciExceptionTool.getExceptionStr(e), VciExceptionTool.getExceptionDetail(e)});
        }
        VCIError rsError = ExceptionLocalHandler.getInstance().getLocalString(error, "RMIPWorkflow");
        return rsError;
    }
}