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 */
016package com.pax.dal.exceptions;
017
018import com.pax.dal.utils.Utils;
019
020public enum ELivenessDetectException {
021    /**
022     * <div class="zh"> 未知异常 </div> <div class="en"> unexpected error </div>
023     */
024    DEVICES_ERR_UNEXPECTED(97, "unexpected error", "未知异常"),
025    /**
026     * <div class="zh"> 参数错误 </div> <div class="en"> invalid argument error </div>
027     */
028    DEVICES_ERR_INVALID_ARGUMENT(98, "invalid argument error", "参数错误"),
029    /**
030     * <div class="zh"> RPC I/O 连接异常 </div> <div class="en"> connect error </div>
031     */
032    DEVICES_ERR_CONNECT(99, "connect error", "RPC I/O 连接异常"),
033    /**
034     * <div class="zh"> 不支持 </div> <div class="en"> not support error </div>
035     */
036    DEVICES_ERR_NO_SUPPORT(100, "not support error", "不支持"),
037    /**
038     * <div class="zh"> 无权限异常</div> <div class="en"> no permission error </div>
039     */
040    DEVICES_ERR_NO_PERMISSION(101,"no permission error","无权限异常"),
041    /**
042     * <div class="zh"> 服务不可用。 </div> <div class="en"> Service not available. </div>
043     */
044    SERVICE_NOT_AVAILABLE(1, "Service not available", "服务不可用"),
045    /**
046     * <div class="zh">执行成功。</div> <div class="en">Exec success.</div>
047     */
048    LIVE_SUC_EXEC(-1, "Exec success", "执行成功"),
049    /**
050     * <div class="zh">执行失败。</div> <div class="en">Exec failure.</div>
051     */
052    LIVE_ERR_EXEC(-2, "Exec failure", "执行失败"),
053    /**
054     * <div class="zh">未能检测到摄像头。</div> <div class="en">The camera could not be detected.</div>
055     */
056    LIVE_ERR_CAMERA(-3, "The camera could not be detected", "未能检测到摄像头"),
057    /**
058     * <div class="zh">未初始化异常。</div> <div class="en">Uninitialized exception.</div>
059     */
060    LIVE_ERR_NOT_INIT(-5, "Uninitialized error.", "未初始化异常"),
061    /**
062     * <div class="zh">未开始检测。</div> <div class="en">Not detection error.</div>
063     */
064    LIVE_ERR_NOT_DETECT(-6, "Not detection error.", "未开始检测"),
065    /**
066     * <div class="zh">未setLiteUICallback。</div> <div class="en">Not setLiteUICallback.</div>
067     */
068    LIVE_ERR_NOT_SETUI(-7, "Not setLiteUICallback.", "未setLiteUICallback"),
069    ;
070
071    private int errCodeFromBasement;
072    private String errMsgCn;
073    private String errMsgEn;
074
075    private ELivenessDetectException(int errCodeFromBasement, String errMsgEn, String errMsnCn) {
076        this.errCodeFromBasement = errCodeFromBasement;
077        this.errMsgCn = errMsnCn;
078        this.errMsgEn = errMsgEn;
079    }
080
081    public int getErrCodeFromBasement() {
082        return errCodeFromBasement;
083    }
084
085    public String getErrMsg() {
086        if (Utils.isZh()) {
087            return errMsgCn;
088        } else {
089            return errMsgEn;
090        }
091
092    }
093}