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
020/**
021 * <div class="zh">OCR异常类。</div> <div class="en">OCR exception.</div>
022 */
023public enum EOCRException {
024    /**
025     * <div class="zh"> 未知异常 </div> <div class="en"> unexpected error </div>
026     */
027    DEVICES_ERR_UNEXPECTED(97, "unexpected error", "未知异常"),
028    /**
029     * <div class="zh"> 参数错误 </div> <div class="en"> invalid argument error </div>
030     */
031    DEVICES_ERR_INVALID_ARGUMENT(98, "invalid argument error", "参数错误"),
032    /**
033     * <div class="zh"> RPC I/O 连接异常 </div> <div class="en"> connect error </div>
034     */
035    DEVICES_ERR_CONNECT(99, "RPC I/O 连接异常", "connect error"),
036    /**
037     * <div class="zh"> 不支持 </div> <div class="en"> not support error </div>
038     */
039    DEVICES_ERR_NO_SUPPORT(100, "不支持", "not support error"),
040    /**
041     * <div class="zh"> 无权限异常</div> <div class="en"> no permission error </div>
042     */
043    DEVICES_ERR_NO_PERMISSION(101,"无权限异常","no permission error"),
044    /**
045     * <div class="zh">服务不可用错误</div> <div class="en">Service not available</div>
046     */
047    SERVICE_NOT_AVAILABLE(1, "服务不可用错误", "Service not available"),
048    /**
049     * <div class="zh">无可用网络</div> <div class="en">Network connection error</div>
050     */
051    NO_AVAILABLE_NETWORK(-3, "无可用网络", "Network connection error"),
052    /**
053     * <div class="zh">请求信息错误或设备未授权</div> <div class="en">Request information error or Unauthorized device</div>
054     */
055    OCR_ERR_REQUEST_INFORMATION(-4, "请求信息错误或设备未授权", "Request information error or Unauthorized device"),
056    /**
057     * <div class="zh">授权信息错误或其他未知错误</div> <div class="en">Authentication information error</div>
058     */
059    OCR_ERR_AUTH_INFORMATION(-5, "授权信息错误或其他未知错误", "Authentication information error"),
060    /**
061     * <div class="zh">摄像头ID设置错误</div> <div class="en">Camera ID error</div>
062     */
063    OCR_ERR_CAMERA_ID(-6, "摄像头ID设置错误", "Camera ID error"),
064    /**
065     * <div class="zh">不支持的证件类型</div> <div class="en">Certificate type error</div>
066     */
067    OCR_ERR_CREDENTIALS_TYPE(-7, "不支持的证件类型", "Certificate type error"),
068    /**
069     * <div class="zh">超时时间设置错误</div> <div class="en">Time value error</div>
070     */
071    OCR_ERR_TIME_VALUE(-8, "超时时间设置错误", "Time value error"),
072    /**
073     * <div class="zh">OCR模块已open</div> <div class="en">The ocr is opened</div>
074     */
075    OCR_ERR_IS_OPEND(-20, "OCR模块已open", "The ocr is opened"),
076    /**
077     * <div class="zh">OCR模块未open</div> <div class="en">The ocr is not opened</div>
078     */
079    OCR_ERR_NOT_OPEND(-21, "OCR模块未open", "The ocr is not opened"),
080    /**
081     * <div class="zh">OCR模块已start</div> <div class="en">The ocr is started</div>
082     */
083    OCR_ERR_IS_STARTED(-22, "OCR模块已start", "The ocr is started"),
084    /**
085     * <div class="zh">OCR模块未start</div> <div class="en">The ocr is not started</div>
086     */
087    OCR_ERR_NOT_STARTED(-23, "OCR模块未start", "The ocr is not started"),
088    ;
089    private int errCodeFromBasement;
090    private String errMsgCn;
091    private String errMsgEn;
092
093    EOCRException(int errCodeFromBasement, String errMsnCn, String errMsgEn) {
094        this.errCodeFromBasement = errCodeFromBasement;
095        this.errMsgCn = errMsnCn;
096        this.errMsgEn = errMsgEn;
097    }
098
099    public int getErrCodeFromBasement() {
100        return errCodeFromBasement;
101    }
102
103    public String getErrMsg() {
104        if (Utils.isZh()) {
105            return errMsgCn;
106        } else {
107            return errMsgEn;
108        }
109
110    }
111}