package com.projectsontracks.model;

/**
 *
 * @author lconfort
 */
public class BroadSQLException extends Exception { 

    private String text = null; // user friendly error message
    private String addText = null; // additional error message
    private String exceptionType = null;

    public BroadSQLException(String msg) {
        this.text = msg;
    }

    /*
     public BroadSQLException(Exception ie) {
     if (ie != null) {
     this.text = ie.getMessage();
     this.exceptionType = ie.getClass().getName();
     }
     }*/
    public BroadSQLException(Throwable ie) {
        if (ie != null) {
            this.text = ie.getMessage();
            this.addText = ie.getMessage();
            this.exceptionType = ie.getClass().getName();
        }
    }

    public BroadSQLException(String message, Throwable ie) {
        if (ie != null) {
            this.text = message;
            this.addText = ie.getMessage();
            this.exceptionType = ie.getClass().getName();
        }
    }

    public String getText() {
        return text;
    }

    public String getExceptionType() {
        return exceptionType;
    }

    public String getAddText() {
        return addText;
    }

    public void setAddText(String addText) {
        this.addText = addText;
    }
}
