/*
 * Decompiled with CFR 0_110.
 * 
 * Could not load the following classes:
 *  java.io.PrintStream
 *  java.io.PrintWriter
 *  java.lang.Exception
 *  java.lang.String
 *  java.lang.StringBuffer
 *  java.lang.System
 *  java.lang.Throwable
 */
package org.dom4j;

import java.io.PrintStream;
import java.io.PrintWriter;

public class DocumentException
extends Exception {
    private Throwable nestedException;

    public DocumentException() {
        super("Error occurred in DOM4J application.");
    }

    public DocumentException(String string2) {
        super(string2);
    }

    public DocumentException(String string2, Throwable throwable) {
        super(string2);
        this.nestedException = throwable;
    }

    public DocumentException(Throwable throwable) {
        super(throwable.getMessage());
        this.nestedException = throwable;
    }

    public String getMessage() {
        if (this.nestedException != null) {
            return new StringBuffer().append(super.getMessage()).append(" Nested exception: ").append(this.nestedException.getMessage()).toString();
        }
        return super.getMessage();
    }

    public Throwable getNestedException() {
        return this.nestedException;
    }

    public void printStackTrace() {
        super.printStackTrace();
        if (this.nestedException != null) {
            System.err.print("Nested exception: ");
            this.nestedException.printStackTrace();
        }
    }

    public void printStackTrace(PrintStream printStream) {
        super.printStackTrace(printStream);
        if (this.nestedException != null) {
            printStream.println("Nested exception: ");
            this.nestedException.printStackTrace(printStream);
        }
    }

    public void printStackTrace(PrintWriter printWriter) {
        super.printStackTrace(printWriter);
        if (this.nestedException != null) {
            printWriter.println("Nested exception: ");
            this.nestedException.printStackTrace(printWriter);
        }
    }
}

