package org.xyzh.common.exception;

/**
 * @description    BaseException.java文件描述 基础异常类
 * @filename    BaseException.java
 * @author    yslg
 * @copyright xyzh
 * @since 2025-09-28
 */
public class BaseException extends RuntimeException{
    private static final long serialVersionUID = 1L;

    /**
     * @description    code
     * @author    yslg
     * @since 2025-09-28
     */
    private String code;

    /**
     * @description    BaseException
     * @author    yslg
     * @since 2025-09-28
     */
    public BaseException(String message) {
        super(message);
    }

    /**
     * @description    BaseException
     * @author    yslg
     * @since 2025-09-28
     */
    public BaseException(String code, String message) {
        super(message);
        this.code = code;
    }

    /**
     * @description    BaseException
     * @author    yslg
     * @since 2025-09-28
     */
    public BaseException(String message, Throwable cause) {
        super(message, cause);
    }

    /**
     * @description    BaseException
     * @author    yslg
     * @since 2025-09-28
     */
    public BaseException(String code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    /**
     * @description    getCode
     * @author    yslg
     * @since 2025-09-28
     */
    public String getCode() {
        return code;
    }

    /**
     * @description    setCode
     * @author    yslg
     * @since 2025-09-28
     */
    public void setCode(String code) {
        this.code = code;
    }
}
