/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.kmnfsw.service.exception; /** * @author admin * @date 2017-12-26 13:42:00 * @version V1.0 * @desc 自定义异常记录 */ public class BasicsException extends RuntimeException{ public static final int UNKNOWN_EXCEPTION = 0; public static final int SQLCONNECT_EXCEPTION = 1; public static final int IO_EXCEPTION = 2; public static final int NULL_EXCEPTION = 3; public static final int IDCONFLICT_EXCEPTION = 4; private int typeCode; private String parameter; public BasicsException() { } public BasicsException(int typeCode, String message) { super(message); this.typeCode = typeCode; this.parameter = "--无"; } public BasicsException(int typeCode, String message , String parameter) { super(message); this.typeCode = typeCode; this.parameter = parameter; } public BasicsException(int typeCode, String message, Throwable cause) { super(message, cause); this.typeCode = typeCode; } public BasicsException(int typeCode, Throwable cause) { super(cause); this.typeCode = typeCode; } public static int getUNKNOWN_EXCEPTION() { return UNKNOWN_EXCEPTION; } public static int getSQLCONNECT_EXCEPTION() { return SQLCONNECT_EXCEPTION; } public static int getIO_EXCEPTION() { return IO_EXCEPTION; } public int getTypeCode() { return typeCode; } public void setTypeCode(int typeCode) { this.typeCode = typeCode; } public String getParameter() { return parameter; } public void setParameter(String parameter) { this.parameter = parameter; } }
自定义异常实体类
最新推荐文章于 2024-06-23 09:32:36 发布