Improve CarpetExpressionException error messages (#1230)
This commit is contained in:
1 parent
de305f4284
commit
f2989d51fd
2 files changed
+4
-4
No files matched your search
@@ -91,7 +91,7 @@ public class CarpetExpression
|
|||||||
public Value scriptRunCommand(ScriptHost host, BlockPos pos)
|
public Value scriptRunCommand(ScriptHost host, BlockPos pos)
|
||||||
{
|
{
|
||||||
if (CarpetServer.scriptServer.stopAll)
|
if (CarpetServer.scriptServer.stopAll)
|
||||||
throw new CarpetExpressionException("SCRIPTING PAUSED", null);
|
throw new CarpetExpressionException("SCRIPTING PAUSED (unpause with /script resume)", null);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Context context = new CarpetContext(host, source, origin).
|
Context context = new CarpetContext(host, source, origin).
|
||||||
|
|||||||
@@ -732,10 +732,10 @@ public class CarpetScriptHost extends ScriptHost
|
|||||||
public Value callLegacy(ServerCommandSource source, String call, List<Integer> coords, String arg)
|
public Value callLegacy(ServerCommandSource source, String call, List<Integer> coords, String arg)
|
||||||
{
|
{
|
||||||
if (CarpetServer.scriptServer.stopAll)
|
if (CarpetServer.scriptServer.stopAll)
|
||||||
throw new CarpetExpressionException("SCARPET PAUSED", null);
|
throw new CarpetExpressionException("SCARPET PAUSED (unpause with /script resume)", null);
|
||||||
FunctionValue function = getFunction(call);
|
FunctionValue function = getFunction(call);
|
||||||
if (function == null)
|
if (function == null)
|
||||||
throw new CarpetExpressionException("UNDEFINED", null);
|
throw new CarpetExpressionException("Couldn't find function '" + call + "' in app '" + this.getName() + "'", null);
|
||||||
List<LazyValue> argv = new ArrayList<>();
|
List<LazyValue> argv = new ArrayList<>();
|
||||||
if (coords != null)
|
if (coords != null)
|
||||||
for (Integer i: coords)
|
for (Integer i: coords)
|
||||||
@@ -832,7 +832,7 @@ public class CarpetScriptHost extends ScriptHost
|
|||||||
public Value call(ServerCommandSource source, FunctionValue function, List<Value> argv)
|
public Value call(ServerCommandSource source, FunctionValue function, List<Value> argv)
|
||||||
{
|
{
|
||||||
if (CarpetServer.scriptServer.stopAll)
|
if (CarpetServer.scriptServer.stopAll)
|
||||||
throw new CarpetExpressionException("SCARPET PAUSED", null);
|
throw new CarpetExpressionException("SCARPET PAUSED (unpause with /script resume)", null);
|
||||||
|
|
||||||
List<String> args = function.getArguments();
|
List<String> args = function.getArguments();
|
||||||
if (argv.size() != args.size())
|
if (argv.size() != args.size())
|
||||||
|
|||||||
Reference in new issue
Block a user