mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 13:43:49 +01:00
NETSCRIPT: Add more helpful error messages to getPurchasedServerCost (#757)
This commit is contained in:
parent
b4f33fe655
commit
9a0d688909
@ -1161,7 +1161,11 @@ export const ns: InternalAPI<NSFull> = {
|
||||
|
||||
const cost = getPurchaseServerCost(ram);
|
||||
if (cost === Infinity) {
|
||||
helpers.log(ctx, () => `Invalid argument: ram='${ram}'`);
|
||||
if (ram > getPurchaseServerMaxRam()) {
|
||||
helpers.log(ctx, () => `Invalid argument: ram='${ram}' must not be greater than getPurchaseServerMaxRam`);
|
||||
} else {
|
||||
helpers.log(ctx, () => `Invalid argument: ram='${ram}' must be a positive power of 2`);
|
||||
}
|
||||
return Infinity;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user