mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 06:48:42 +02:00
better error message for bad args
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -651,9 +651,12 @@ export function runScriptFromScript(
|
||||
return 0;
|
||||
}
|
||||
|
||||
args.forEach((arg) => {
|
||||
args.forEach((arg, i) => {
|
||||
if (typeof arg !== "string" && typeof arg !== "number" && typeof arg !== "boolean")
|
||||
throw new Error("Only strings, numbers, and booleans can be passed as arguments to otherscripts.");
|
||||
throw new Error(
|
||||
"Only strings, numbers, and booleans can be passed as arguments to other scripts.\n" +
|
||||
`${scriptname} argument index ${i} is of type ${typeof arg} and value ${JSON.stringify(arg)}`,
|
||||
);
|
||||
});
|
||||
|
||||
// Check if the script is already running
|
||||
|
||||
Reference in New Issue
Block a user