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

fun.bigtable.kraken.exception.BusinessException Maven / Gradle / Ivy

There is a newer version: 2.0.9.1
Show newest version
package fun.bigtable.kraken.exception;


public class BusinessException extends RuntimeException {
    private static final long serialVersionUID = 1L;
    private final Type type;
    private String errCode;

    public BusinessException(Type type, String errCode, String message) {
        super();
        this.type = type;
        this.errCode = errCode;
    }


    public BusinessException(Type type) {
        super();
        this.type = type;
    }

    public BusinessException(String message) {
        super(message);
        this.type = Type.DEFAULT_ERROR;
    }

    public BusinessException(Type type, String message) {
        super(message);
        this.type = type;
    }

    public BusinessException(Throwable throwable, Type type) {
        super(throwable);
        this.type = type;
    }

    @Override
    public String toString() {
        return super.toString() + "<" + getErrorType().getErrorCode() + ">";
    }

    public Type getErrorType() {
        return type;
    }

    public String getErrCode() {
        return errCode;
    }

    public static BusinessException newInstance(Type type) {
        return new BusinessException(type);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy