ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.vci.server.bof.delegate;
 
 
import com.vci.common.exception.VciExceptionTool;
import com.vci.corba.common.VCIError;
import com.vci.server.base.exception.ExceptionLocalHandler;
 
public class FactoryBaseDelegate {
 
    /**
     * 获取国际化的错误提示信息,将其设置到VCIError的key中
     * @param VCIError
     * @return
     */
    public VCIError getLocalString(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, "PLMBOFactory");
        return rsError;
    }
}