package com.moral.api.exception; 
 | 
  
 | 
/** 
 | 
 * @author 
 | 
 * @site 
 | 
 * @company 
 | 
 * @create 2021-02-26 11:20 
 | 
 */ 
 | 
public class BusinessException extends RuntimeException { 
 | 
  
 | 
    /** 
 | 
     * 错误码 
 | 
     */ 
 | 
    private String code; 
 | 
  
 | 
    /** 
 | 
     * 错误信息 
 | 
     */ 
 | 
    private String msg; 
 | 
  
 | 
    /**  */ 
 | 
    private static final long serialVersionUID = 1L; 
 | 
  
 | 
    public BusinessException() { 
 | 
        super(); 
 | 
    } 
 | 
  
 | 
    public BusinessException(String msg) { 
 | 
        super(msg); 
 | 
        this.msg = msg; 
 | 
    } 
 | 
  
 | 
    public BusinessException(Throwable t) { 
 | 
        super(t); 
 | 
    } 
 | 
  
 | 
    public BusinessException(String msg, Throwable t) { 
 | 
        super(msg); 
 | 
        this.msg = msg; 
 | 
    } 
 | 
  
 | 
    public BusinessException(String code, String msg) { 
 | 
        super(msg); 
 | 
        this.code = code; 
 | 
        this.msg = msg; 
 | 
    } 
 | 
  
 | 
    public BusinessException(String code, String msg, Throwable t) { 
 | 
        super(msg, t); 
 | 
        this.code = code; 
 | 
        this.msg = msg; 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * Getter method for property <tt>code</tt>. 
 | 
     * 
 | 
     * @return property value of code 
 | 
     */ 
 | 
    public String getCode() { 
 | 
        return code; 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * Getter method for property <tt>msg</tt>. 
 | 
     * 
 | 
     * @return property value of msg 
 | 
     */ 
 | 
    public String getMsg() { 
 | 
        return msg; 
 | 
    } 
 | 
  
 | 
} 
 |