package com.keyware.shandan.datasource.exception;

import com.keyware.shandan.datasource.enums.ErrorType;
import lombok.Getter;
import lombok.Setter;

/**
 * DBDriverException
 *
 * @author GuoXin
 * @since 2021/7/28
 */
@Getter
@Setter
public class DBDriverException extends Exception {

    private static final long serialVersionUID = -341580065125144014L;

    private ErrorType type = ErrorType.OTHER;

    public DBDriverException(ErrorType type, String message) {
        super(message);
        this.type = type;
    }

    public DBDriverException(ErrorType type) {
        super(type.getMsg());
        this.type = type;
    }

    public DBDriverException(ErrorType type, Throwable throwable) {
        super(type.getMsg(), throwable);
        this.type = type;
    }
}
