自定义异常实体类

/*
 * 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;
    }
      
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值