package util;

import java.io.PrintStream;
import java.io.PrintWriter;

public class RepositorioException extends Exception {

    private Throwable exception;
    
    public RepositorioException(Throwable ex) {
        while (ex instanceof RepositorioException) {
            ex = ((RepositorioException)ex).getException();
        }
        
        exception = ex;
    }
    
    public Throwable fillInStackTrace() {
        return this.exception.fillInStackTrace();
    }

    public String getLocalizedMessage() {
        return this.exception.getLocalizedMessage();
    }

    public String getMessage() {
        return this.exception.getMessage();
    }

    public void printStackTrace() {
        this.exception.printStackTrace();
    }    
    
    public void printStackTrace(PrintStream s) {
        this.exception.printStackTrace(s);
    }
    
    public void printStackTrace(PrintWriter s) {
        this.exception.printStackTrace(s);
    }    

    public String toString() {
        return this.exception.toString();
    }
    
    public Throwable getException() {
        return this.exception;
    }    
        
}

