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 EBaseDevException { 021 022 /** 023 * <div class="zh"> 未知异常 </div> <div class="en"> unexpected error </div> 024 */ 025 DEVICES_ERR_UNEXPECTED(97, "unexpected error", "未知异常"), 026 027 /** 028 * <div class="zh"> 参数错误 </div> <div class="en"> invalid argument error </div> 029 */ 030 DEVICES_ERR_INVALID_ARGUMENT(98, "invalid argument error", "参数错误"), 031 /** 032 * <div class="zh"> RPC I/O 连接异常 </div> <div class="en"> connect error </div> 033 */ 034 DEVICES_ERR_CONNECT(99, "connect error", "RPC I/O 连接异常"), 035 /** 036 * <div class="zh"> 不支持 </div> <div class="en"> not support error </div> 037 */ 038 DEVICES_ERR_NO_SUPPORT(100, "not support error", "不支持"), 039 /** 040 * <div class="zh"> 无权限异常</div> <div class="en"> no permission error </div> 041 */ 042 DEVICES_ERR_NO_PERMISSION(101,"no permission error","无权限异常"), 043 044 /** 045 * <div class="zh">文件类型错误</div> <div class="en">file type error</div> 046 */ 047 BASE_ERR_FILE_TYPE(-6, "file type error", "文件类型错误"), 048 049 /** 050 * <div class="zh">通信超时</div> <div class="en">comm time out error</div> 051 */ 052 BASE_ERR_COMM_TIME_OUT(-4, "comm time out error", "通信超时"), 053 054 /** 055 * <div class="zh">文件不存在</div> <div class="en">file not exist error</div> 056 */ 057 BASE_ERR_FILE_NO_EXIST(-2, "file not exist error", "文件不存在"), 058 059 /** 060 * <div class="zh">文件太大</div> <div class="en">file too big error</div> 061 */ 062 BASE_ERR_FILE_TOOBIG(-14, "file too big error", "文件太大"), 063 064 /** 065 * <div class="zh">读取底座配置信息失败 </div> <div class="en">get configuration error</div> 066 */ 067 BASE_ERR_GET_CFG(-99, "get configuration error", "读取底座配置信息失败"), 068 069 /** 070 * <div class="zh">没有此Key对应的配置信息</div> <div class="en">No configuration for this key</div> 071 */ 072 BASE_ERR_NOT_SUPPORT_CFG_KEY(-100, "Not Support for this config key", "不支持该配置信息键值"), 073 074 /** 075 * <div class="zh">参数错误</div> <div class="en">invalid argument error</div> 076 */ 077 BASE_ERR_PARAM(-12, "invalid argument error", "参数错误"), 078 079 /** 080 * <div class="zh">读文件错误</div> <div class="en">read file error</div> 081 */ 082 BASE_ERR_READ_FILE(-8, "read file error", "读文件错误"), 083 084 /** 085 * <div class="zh">文件签名错误</div> <div class="en">file signature error</div> 086 */ 087 BASE_ERR_FIle_SIG(-1, "file signature error", "文件签名错误"), 088 089 /** 090 * <div class="zh">写文件错误</div> <div class="en">write file error</div> 091 */ 092 BASE_ERR_WRITE_FILE(-7, "write file error", "写文件错误"), 093 094 /** 095 * <div class="zh">服务不可用错误</div> <div class="en">service not available</div> 096 */ 097 SERVICE_NOT_AVAILABLE(1, "service not available", "服务不可用错误"); 098 099 private int errCodeFromBasement; 100 private String errMsgCn; 101 private String errMsgEn; 102 103 private EBaseDevException(int errCodeFromBasement, String errMsgEn, String errMsnCn) { 104 this.errCodeFromBasement = errCodeFromBasement; 105 this.errMsgEn = errMsgEn; 106 this.errMsgCn = errMsnCn; 107 } 108 109 public int getErrCodeFromBasement() { 110 return errCodeFromBasement; 111 } 112 113 public String getErrMsg() { 114 if (Utils.isZh()) { 115 return errMsgCn; 116 } else { 117 return errMsgEn; 118 } 119 120 } 121}