001/*
002 * JGrapes Event Driven Framework
003 * Copyright (C) 2016-2018 Michael N. Lipp
004 * 
005 * This program is free software; you can redistribute it and/or modify it 
006 * under the terms of the GNU Affero General Public License as published by 
007 * the Free Software Foundation; either version 3 of the License, or 
008 * (at your option) any later version.
009 * 
010 * This program is distributed in the hope that it will be useful, but 
011 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
012 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License 
013 * for more details.
014 * 
015 * You should have received a copy of the GNU Affero General Public License along 
016 * with this program; if not, see <http://www.gnu.org/licenses/>.
017 */
018
019package org.jgrapes.io.events;
020
021import org.jgrapes.core.Event;
022import org.jgrapes.core.events.Error;
023
024/**
025 * A special kind of {@link Error} that signals I/O related problems.
026 * 
027 * @see Closed
028 */
029@SuppressWarnings("PMD.DoNotExtendJavaLangError")
030public class IOError extends Error {
031
032    /**
033     * Creates a new event as a copy of an existing event. Useful
034     * for forwarding an event.
035     *
036     * @param event the event to copy
037     */
038    public IOError(IOError event) {
039        super(event);
040    }
041
042    /**
043     * Creates a new instance.
044     * 
045     * @param event the event that was being handled when the problem occurred
046     * @param message the message
047     */
048    public IOError(Event<?> event, String message) {
049        super(event, message);
050    }
051
052    /**
053     * Creates a new instance.
054     * 
055     * @param event the event that was being handled when the problem occurred
056     * @param message the message
057     * @param throwable the encountered throwable
058     */
059    public IOError(Event<?> event, String message, Throwable throwable) {
060        super(event, message, throwable);
061    }
062
063    /**
064     * Creates a new instance.
065     * 
066     * @param event the event that was being handled when the problem occurred
067     * @param throwable the encountered throwable
068     */
069    public IOError(Event<?> event, Throwable throwable) {
070        super(event, throwable);
071    }
072
073}