All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mathiewz.slick.opengl.CompositeIOException Maven / Gradle / Ivy

Go to download

The main purpose of this libraryis to modernize and maintain the slick2D library.

The newest version!
package com.github.mathiewz.slick.opengl;

import java.io.IOException;
import java.util.ArrayList;

/**
 * A collection of IOException that failed image data loading
 *
 * @author kevin
 */
public class CompositeIOException extends IOException {
    /** The list of exceptions causing this one */
    private final ArrayList exceptions = new ArrayList<>();

    /**
     * Create a new composite IO Exception
     */
    public CompositeIOException() {
        super();
    }

    /**
     * Add an exception that caused this exceptino
     *
     * @param e
     *            The exception
     */
    public void addException(Exception e) {
        exceptions.add(e);
    }

    /**
     * @see java.lang.Throwable#getMessage()
     */
    @Override
    public String getMessage() {
        String msg = "Composite Exception: \n";
        for (int i = 0; i < exceptions.size(); i++) {
            msg += "\t" + ((IOException) exceptions.get(i)).getMessage() + "\n";
        }

        return msg;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy