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 EFaceDetectException {
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 failure.</div>
047     */
048    FACE_ERR_EXEC(-2, "Exec failure", "执行失败"),
049    /**
050     * <div class="zh">访问服务器失败。</div> <div class="en">Server access failed.</div>
051     */
052    FACE_ERR_ACCESS_SERVER(-3, "Server access failed", "访问服务器失败"),
053    /**
054     * <div class="zh">请求信息错误或设备未授权。</div> <div class="en">Request information error or device unauthorized.</div>
055     */
056    FACE_ERR_DEVICE_NOT_AUTH(-4, "Request information error or device unauthorized", "请求信息错误或设备未授权"),
057    /**
058     * <div class="zh">授权信息错误。</div> <div class="en">Authorization information error</div>
059     */
060    FACE_ERR_AUTH_INFO(-5, "Authorization information error", "授权信息错误"),
061    /**
062     * <div class="zh">检测不到人脸。</div> <div class="en">No face detected.</div>
063     */
064    FACE_ERR_NO_FACE(-6, "No face detected", "检测不到人脸"),
065    /**
066     * <div class="zh">未初始化。</div> <div class="en">Serice is not initialized.</div>
067     */
068    FACE_ERR_NOT_INIT(-7, "Serice is not initialized", "未初始化"),
069    /**
070     * <div class="zh">图片分辨率太大。</div> <div class="en">The picture resolution is too large</div>
071     */
072    FACE_ERR_PIC_TOO_LARGE(-8, "The picture resolution is too large", "图片分辨率太大"),
073    /**
074     * <div class="zh">矩形区域在Bitmap外。</div> <div class="en">The rectangular area is outside the bitmap.</div>
075     */
076    FACE_ERR_OUTSIDE_BITMAP(-11, "The rectangular area is outside the bitmap", "矩形区域在Bitmap外");
077
078    private int errCodeFromBasement;
079    private String errMsgCn;
080    private String errMsgEn;
081
082    private EFaceDetectException(int errCodeFromBasement, String errMsgEn, String errMsnCn) {
083        this.errCodeFromBasement = errCodeFromBasement;
084        this.errMsgCn = errMsnCn;
085        this.errMsgEn = errMsgEn;
086    }
087
088    public int getErrCodeFromBasement() {
089        return errCodeFromBasement;
090    }
091
092    public String getErrMsg() {
093        if (Utils.isZh()) {
094            return errMsgCn;
095        } else {
096            return errMsgEn;
097        }
098    }
099}