|
@@ -535,7 +535,12 @@ public class SnuviParser
|
|
|
Throwable t = ((InvocationTargetException) ex).getCause();
|
|
|
if(t != null && t instanceof Exception)
|
|
|
{
|
|
|
- logger.printException((Exception) t);
|
|
|
+ if(t instanceof PreScriptException)
|
|
|
+ {
|
|
|
+ logger.printException((Exception) t, scriptName, ((PreScriptException) t).getLine());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ logger.printException((Exception) t, scriptName, -1);
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
@@ -645,6 +650,11 @@ public class SnuviParser
|
|
|
|
|
|
private void scheduleGoto(Object[] args, Script sc)
|
|
|
{
|
|
|
+ int time = getInt(args[0]);
|
|
|
+ if(time < 0)
|
|
|
+ {
|
|
|
+ throw new IllegalArgumentException("time units can't be negative");
|
|
|
+ }
|
|
|
scheduler.scheduleTask(() ->
|
|
|
{
|
|
|
if(!sc.isValid() && !sc.isHalt())
|
|
@@ -660,7 +670,7 @@ public class SnuviParser
|
|
|
{
|
|
|
logger.printException(ex, sc, sc.getActiveRealCodeLine());
|
|
|
}
|
|
|
- }, getInt(args[0]));
|
|
|
+ }, time);
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("")
|