2 * FreenetSone - SoneException.java - Copyright © 2010 David Roden
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package net.pterodactylus.sone.core;
23 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
25 public class SoneException extends Exception {
28 * Defines the different error. This is an enum instead of custom exceptions
29 * to keep the number of exceptions down. Specialized exceptions might still
32 public static enum Type {
34 /** An invalid URI was specified. */
38 /** The type of the exception. */
39 private final Type type;
42 * Creates a new Sone exception.
45 * The type of the occured error
47 public SoneException(Type type) {
52 * Creates a new Sone exception.
55 * The type of the occured error
57 * The message of the exception
59 public SoneException(Type type, String message) {
65 * Creates a new Sone exception.
68 * The type of the occured error
70 * The cause of the exception
72 public SoneException(Type type, Throwable cause) {
78 * Creates a new Sone exception.
81 * The type of the occured error
83 * The message of the exception
85 * The cause of the exception
87 public SoneException(Type type, String message, Throwable cause) {
88 super(message, cause);
97 * Returns the type of this exception.
99 * @return The type of this exception (may be {@code null})
101 public Type getType() {