mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 21:53:50 +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);
|
const cost = getPurchaseServerCost(ram);
|
||||||
if (cost === Infinity) {
|
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;
|
return Infinity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user