All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.dragons96.exception.BaseException Maven / Gradle / Ivy

There is a newer version: 0.0.4
Show newest version
package io.github.dragons96.exception;

import io.github.dragons96.IResponseEnum;

/**
 * 基础异常
 * @author dragons
 * @date 2022/3/16 10:24
 */
public class BaseException extends RuntimeException {

    private IResponseEnum responseEnum;

    private Object[] args;

    public BaseException() {
    }

    public BaseException(String message) {
        super(message);
    }

    public BaseException(String message, Throwable cause) {
        super(message, cause);
    }

    public BaseException(Throwable cause) {
        super(cause);
    }

    public BaseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public BaseException(IResponseEnum responseEnum) {
        super(responseEnum.getMessage());
        this.responseEnum = responseEnum;
    }

    public BaseException(IResponseEnum responseEnum, Throwable cause) {
        super(responseEnum.getMessage(), cause);
        this.responseEnum = responseEnum;
    }

    public BaseException(IResponseEnum responseEnum, Object[] args, String message) {
        super(message);
        this.responseEnum = responseEnum;
        this.args = args;
    }

    public BaseException(IResponseEnum responseEnum, Object[] args, String message, Throwable cause) {
        super(message, cause);
        this.responseEnum = responseEnum;
        this.args = args;
    }

    public IResponseEnum getResponseEnum() {
        return responseEnum;
    }

    public Object[] getArgs() {
        return args;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy