diff --git a/src/main/java/carpet/script/exception/ThrowStatement.java b/src/main/java/carpet/script/exception/ThrowStatement.java index b8cb4155..527befe1 100644 --- a/src/main/java/carpet/script/exception/ThrowStatement.java +++ b/src/main/java/carpet/script/exception/ThrowStatement.java @@ -39,9 +39,10 @@ public class ThrowStatement extends InternalExpressionException * Conveniently creates a value from the {@code value} String * to be used easily in Java code * @param message The message to display when not handled - * @param value A String that will be converted - * to a value to pass to {@code catch} - * blocks + * @param exception An {@link Exception} containing the inheritance data + * for this exception. When throwing from Java, + * those exceptions should be pre-registered and used + * instead of creating new ones each time. * @param parent This exception's data */ public ThrowStatement(String message, Exception exception) diff --git a/src/main/java/carpet/script/exception/Throwables.java b/src/main/java/carpet/script/exception/Throwables.java index ab6af103..ba42f993 100644 --- a/src/main/java/carpet/script/exception/Throwables.java +++ b/src/main/java/carpet/script/exception/Throwables.java @@ -65,6 +65,8 @@ public class Throwables { *

Parent will default to {@link Throwables#USER_DEFINED} if provided * parentValue meets Value#isNull, else it will create a new {@link Exception}, * with its parent being {@link Throwables#USER_DEFINED}. + *

If passed parent matches {@link Throwables#ERROR}, it will create an error + * exception, which cannot be caught. * @param value The {@link Value} of the exception * @param parentValue An optional {@link Value} matching the name of a parent exception. *
Accepts a {@link NullValue}, but not a {@code null} @@ -98,7 +100,7 @@ public class Throwables { } /** - * Checks whether the given filter matches an instance of this exception, including checking equality + * Checks whether the given filter matches an instance of this exception, by checking equality * with itself and possible parents. * @param filter The {@link Value} to check against * @return Whether or not the given value matches this exception's hierarchy