package usda.weru.remoteDataAccess.exceptions;

/**
 *
 * @author mhaas
 */
public class BackgroundLoadException extends Exception {
    private static final long serialVersionUID = 1L;
    
    public static enum BackgroundLoadExceptionType {
        GENERIC,
        CONNECTION
    }
    
    protected String serviceName;
    protected BackgroundLoadExceptionType type;

    public BackgroundLoadException (String message, Throwable cause, String serviceName) {
        this (message, cause, serviceName, BackgroundLoadExceptionType.GENERIC);
    }
    
    public BackgroundLoadException (String message, Throwable cause, String serviceName, BackgroundLoadExceptionType type) {
        super(message, cause);

        this.serviceName = serviceName;
        this.type = type;
    }

    public String getServiceName () {
        return serviceName;
    }

    public BackgroundLoadExceptionType getType () {
        return type;
    }
    
}
