aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/com/jantuomi/tunkki/exception
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/com/jantuomi/tunkki/exception')
-rw-r--r--src/main/com/jantuomi/tunkki/exception/types/FileNotFoundTunkkiError.java20
-rw-r--r--src/main/com/jantuomi/tunkki/exception/types/OutOfBoundsTunkkiError.java20
-rw-r--r--src/main/com/jantuomi/tunkki/exception/types/RecursiveIncludeTunkkiError.java20
-rw-r--r--src/main/com/jantuomi/tunkki/exception/types/TunkkiError.java3
4 files changed, 62 insertions, 1 deletions
diff --git a/src/main/com/jantuomi/tunkki/exception/types/FileNotFoundTunkkiError.java b/src/main/com/jantuomi/tunkki/exception/types/FileNotFoundTunkkiError.java
new file mode 100644
index 0000000..6bd60d6
--- /dev/null
+++ b/src/main/com/jantuomi/tunkki/exception/types/FileNotFoundTunkkiError.java
@@ -0,0 +1,20 @@
+package com.jantuomi.tunkki.exception.types;
+
+/**
+ * Created by jan on 3.8.2016.
+ */
+public class FileNotFoundTunkkiError extends TunkkiError {
+ public FileNotFoundTunkkiError(int line, String... args) {
+ super(line, args);
+ }
+
+ @Override
+ public String what() {
+ return "File %s could not be found.";
+ }
+
+ @Override
+ ExceptionType getType() {
+ return ExceptionType.FileNotFoundError;
+ }
+}
diff --git a/src/main/com/jantuomi/tunkki/exception/types/OutOfBoundsTunkkiError.java b/src/main/com/jantuomi/tunkki/exception/types/OutOfBoundsTunkkiError.java
new file mode 100644
index 0000000..16c30ae
--- /dev/null
+++ b/src/main/com/jantuomi/tunkki/exception/types/OutOfBoundsTunkkiError.java
@@ -0,0 +1,20 @@
+package com.jantuomi.tunkki.exception.types;
+
+/**
+ * Created by jan on 3.8.2016.
+ */
+public class OutOfBoundsTunkkiError extends TunkkiError {
+ public OutOfBoundsTunkkiError(int line, String... args) {
+ super(line, args);
+ }
+
+ @Override
+ public String what() {
+ return "Index %s is out of bounds.";
+ }
+
+ @Override
+ ExceptionType getType() {
+ return ExceptionType.OutOfBoundsError;
+ }
+}
diff --git a/src/main/com/jantuomi/tunkki/exception/types/RecursiveIncludeTunkkiError.java b/src/main/com/jantuomi/tunkki/exception/types/RecursiveIncludeTunkkiError.java
new file mode 100644
index 0000000..3cb359d
--- /dev/null
+++ b/src/main/com/jantuomi/tunkki/exception/types/RecursiveIncludeTunkkiError.java
@@ -0,0 +1,20 @@
+package com.jantuomi.tunkki.exception.types;
+
+/**
+ * Created by jan on 3.8.2016.
+ */
+public class RecursiveIncludeTunkkiError extends TunkkiError {
+ public RecursiveIncludeTunkkiError(int line, String... args) {
+ super(line, args);
+ }
+
+ @Override
+ public String what() {
+ return "Recursive include with module name '%s' detected.";
+ }
+
+ @Override
+ ExceptionType getType() {
+ return ExceptionType.RecursiveIncludeError;
+ }
+}
diff --git a/src/main/com/jantuomi/tunkki/exception/types/TunkkiError.java b/src/main/com/jantuomi/tunkki/exception/types/TunkkiError.java
index 62c2114..c99e8f9 100644
--- a/src/main/com/jantuomi/tunkki/exception/types/TunkkiError.java
+++ b/src/main/com/jantuomi/tunkki/exception/types/TunkkiError.java
@@ -22,7 +22,8 @@ abstract public class TunkkiError extends Exception {
GeneralError,
CastError,
DivisionByZeroError,
- NadaError
+ RecursiveIncludeError,
+ OutOfBoundsError, FileNotFoundError, NadaError
}
private int line;