FileDocCategorySizeDatePackage
DataException.javaAPI DocExample749Sun Sep 02 14:59:04 BST 2001com.oreilly.forum.adapter

DataException.java

package com.oreilly.forum.adapter;

/**
 * An exception that indicates some operation with the back-end
 * data source failed.
 */
public class DataException extends Exception {
    private Throwable rootCause;

    /**
     * Wrap a DataException around another throwable.
     */
    public DataException(Throwable rootCause) {
        super(rootCause.getMessage());
        this.rootCause = rootCause;
    }

    /**
     * Construct an exception with the specified detail message.
     */
    public DataException(String message) {
        super(message);
    }

    /**
     * @return a reference to the root exception or null.
     */
    public Throwable getRootCause() {
        return this.rootCause;
    }
}