This commit is contained in:
gnembon committed 2021-03-08 00:44:40 -04:00
1 parent 36eccbc2df
commit d48f78ff7b
5 files changed
+118 -166

No files matched your search

@@ -6,14 +6,15 @@ import carpet.script.Context;
import carpet.script.Expression;
import carpet.script.Tokenizer.Token;
import carpet.script.value.FunctionValue;
import carpet.script.value.Value;
public class ProcessedThrowStatement extends ExpressionException {
public final Throwables.Exception exception;
public final String message;
public final Throwables thrownExceptionType;
public final Value data;
public ProcessedThrowStatement(Context c, Expression e, Token token, String message, List<FunctionValue> stack, Throwables.Exception exception) {
super(c, e, token, "Unhandled exception: "+message, stack);
this.exception = exception;
this.message = message;
public ProcessedThrowStatement(Context c, Expression e, Token token, List<FunctionValue> stack, Throwables thrownExceptionType, Value data) {
super(c, e, token, () -> "Unhandled "+thrownExceptionType.getId()+" exception: "+data.getString(), stack);
this.thrownExceptionType = thrownExceptionType;
this.data = data;
}
}