aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc/lll/exceptions/InvalidResourceException.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/ftbsc/lll/exceptions/InvalidResourceException.java')
-rw-r--r--src/main/java/ftbsc/lll/exceptions/InvalidResourceException.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/ftbsc/lll/exceptions/InvalidResourceException.java b/src/main/java/ftbsc/lll/exceptions/InvalidResourceException.java
new file mode 100644
index 0000000..060d57c
--- /dev/null
+++ b/src/main/java/ftbsc/lll/exceptions/InvalidResourceException.java
@@ -0,0 +1,23 @@
+package ftbsc.lll.exceptions;
+
+/**
+ * Thrown when a resource passed as an argument is not found.
+ */
+public class InvalidResourceException extends RuntimeException {
+
+ /**
+ * Empty constructor, used when the provided resource exists but no
+ * mapper was able to read it.
+ */
+ public InvalidResourceException() {
+ super("The given resource was not claimed by any mapper!");
+ }
+
+ /**
+ * Named constructor, used when the specified resource doesn't exist.
+ * @param name the resource name
+ */
+ public InvalidResourceException(String name) {
+ super(String.format("Specified resource %s was not found!", name));
+ }
+}