summaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc/lll/exceptions
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/ftbsc/lll/exceptions')
-rw-r--r--src/main/java/ftbsc/lll/exceptions/AmbiguousDefinitionException.java25
-rw-r--r--src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java17
-rw-r--r--src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java15
3 files changed, 57 insertions, 0 deletions
diff --git a/src/main/java/ftbsc/lll/exceptions/AmbiguousDefinitionException.java b/src/main/java/ftbsc/lll/exceptions/AmbiguousDefinitionException.java
new file mode 100644
index 0000000..1befaa8
--- /dev/null
+++ b/src/main/java/ftbsc/lll/exceptions/AmbiguousDefinitionException.java
@@ -0,0 +1,25 @@
+package ftbsc.lll.exceptions;
+
+/**
+ * Thrown when the processor finds multiple methods matching the
+ * given criteria.
+ */
+public class AmbiguousDefinitionException extends RuntimeException {
+
+ /**
+ * Constructs a new ambiguous definition exception with the specified detail message.
+ * @param message the detail message
+ */
+ public AmbiguousDefinitionException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new ambiguous definition exception with the specified detail message and cause.
+ * @param message the detail message
+ * @param cause the cause, may be null (indicating nonexistent or unknown cause)
+ */
+ public AmbiguousDefinitionException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java b/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java
new file mode 100644
index 0000000..817761b
--- /dev/null
+++ b/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java
@@ -0,0 +1,17 @@
+package ftbsc.lll.exceptions;
+
+import ftbsc.lll.processor.tools.SrgMapper;
+
+/**
+ * Thrown upon failure to find the requested mapping within a loaded {@link SrgMapper}.
+ */
+public class MappingNotFoundException extends RuntimeException {
+
+ /**
+ * Constructs a new mapping not found exception for the specified mapping.
+ * @param mapping the detail message
+ */
+ public MappingNotFoundException(String mapping) {
+ super("Could not find mapping for " + mapping + "!");
+ }
+}
diff --git a/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java b/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java
new file mode 100644
index 0000000..5be3d77
--- /dev/null
+++ b/src/main/java/ftbsc/lll/exceptions/TargetNotFoundException.java
@@ -0,0 +1,15 @@
+package ftbsc.lll.exceptions;
+
+/**
+ * Thrown upon failure to find an existing method from a stub.
+ */
+public class TargetNotFoundException extends RuntimeException {
+
+ /**
+ * Constructs a new target not found exception for the specified method stub.
+ * @param stub the stub's name (and descriptor possibly)
+ */
+ public TargetNotFoundException(String stub) {
+ super("Could not find member corresponding to stub: " + stub);
+ }
+}