001 /*
002 * ===========================================================================================
003 * = COPYRIGHT
004 *          PAX Computer Technology (Shenzhen) Co., Ltd. PROPRIETARY INFORMATION
005 *   This software is supplied under the terms of a license agreement or nondisclosure
006 *   agreement with PAX Computer Technology (Shenzhen) Co., Ltd. and may not be copied or
007 *   disclosed except in accordance with the terms in that agreement.
008 *     Copyright (C) 2017-2023 PAX Computer Technology (Shenzhen) Co., Ltd. All rights reserved.
009 * Description: // Detail description about the function of this module,
010 *             // interfaces with the other modules, and dependencies.
011 * Revision History:
012 * Date                         Author                        Action
013 * 2017/04/01                   PAX                     Create/Add/Modify/Delete
014 * ===========================================================================================
015 */
016 
017package com.pax.dal.exceptions;
018
019import com.pax.dal.utils.Utils;
020
021public enum EWLTaxDevException {
022    /**
023     * <div class="zh"> 未知异常 </div> <div class="en"> unexpected error </div>
024     */
025    DEVICES_ERR_UNEXPECTED(97, "unexpected error", "未知异常"),
026    /**
027     * <div class="zh"> 参数错误 </div> <div class="en"> invalid argument error </div>
028     */
029    DEVICES_ERR_INVALID_ARGUMENT (98, "invalid argument error", "参数错误"),
030    /**
031     * <div class="zh"> RPC I/O 连接异常 </div> <div class="en"> connect error </div>
032     */
033    DEVICES_ERR_CONNECT(99, "connect error", "RPC I/O 连接异常"),
034    /**
035     * <div class="zh"> 不支持 </div> <div class="en"> not support error </div>
036     */
037    DEVICES_ERR_NO_SUPPORT(100, "not support error", "不支持"),
038    /**
039     * <div class="zh"> 通讯失败 </div> <div class="en"> Communication failure </div>
040     */
041    DEVICES_ERR_COMMUNICATION_FAILURE(-1006, "Communication failure", "通讯失败"),
042    /**
043     * <div class="zh"> 无权限异常 </div> <div class="en"> no permission error </div>
044     */
045    NO_PERMISSION_CALL_ERROR(-52, "no permission error", "无调用权限")
046    ;
047    private int errCodeFromBasement;
048    private String errMsgCn;
049    private String errMsgEn;
050
051    private EWLTaxDevException(int errCodeFromBasement, String errMsgEn, String errMsnCn) {
052        this.errCodeFromBasement = errCodeFromBasement;
053        this.errMsgCn = errMsnCn;
054        this.errMsgEn = errMsgEn;
055    }
056
057    public int getErrCodeFromBasement() {
058        return errCodeFromBasement;
059    }
060
061    public String getErrMsg() {
062        if (Utils.isZh()) {
063            return errMsgCn;
064        } else {
065            return errMsgEn;
066        }
067
068    }
069
070}