better handling of unknown exceptions

This commit is contained in:
gnembon committed 2019-07-11 14:43:49 -03:00
1 parent 75a8449228
commit 6e2ee7605f
2 files changed
+69 -1

No files matched your search

+41 -1
View File
@@ -506,6 +506,14 @@ public class Expression implements Cloneable
{
throw new ExpressionException(e, token, "Your math is wrong, "+exc.getMessage());
}
catch (ExitStatement exit)
{
throw exit;
}
catch (Exception exc)
{
throw new ExpressionException(e, token, "Error while evaluating expression: "+exc.getMessage());
}
}
});
}
@@ -532,6 +540,14 @@ public class Expression implements Cloneable
{
throw new ExpressionException(e, t, "Your math is wrong, "+exc.getMessage());
}
catch (ExitStatement exit)
{
throw exit;
}
catch (Exception exc)
{
throw new ExpressionException(e, t, "Error while evaluating expression: "+exc.getMessage());
}
}
});
}
@@ -557,6 +573,14 @@ public class Expression implements Cloneable
{
throw new ExpressionException(e, token, "Your math is wrong, "+exc.getMessage());
}
catch (ExitStatement exit)
{
throw exit;
}
catch (Exception exc)
{
throw new ExpressionException(e, token, "Error while evaluating expression: "+exc.getMessage());
}
}
});
}
@@ -663,6 +687,14 @@ public class Expression implements Cloneable
{
throw new ExpressionException(e, t, "Your math is wrong, "+exc.getMessage());
}
catch (ExitStatement exit)
{
throw exit;
}
catch (Exception exc)
{
throw new ExpressionException(e, t, "Error while evaluating expression: "+exc.getMessage());
}
}
});
}
@@ -725,7 +757,7 @@ public class Expression implements Cloneable
{
retVal = returnStatement.retval;
}
catch (ThrowStatement throwStatement)
catch (ThrowStatement throwStatement) // might not be really necessary
{
retVal = throwStatement.retval;
rethrow = true;
@@ -738,6 +770,14 @@ public class Expression implements Cloneable
{
throw new ExpressionException(function_context, t, "Your math is wrong, "+exc.getMessage());
}
catch (ExitStatement exit)
{
throw exit;
}
catch (Exception exc)
{
throw new ExpressionException(e, t, "Error while evaluating expression: "+exc.getMessage());
}
for (String global: globals)
{
LazyValue lv = newFrame.getVariable(global);