mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-04 06:37:49 +02:00
Make invalid hostname better
This commit is contained in:
@@ -166,7 +166,8 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
const safeGetServer = function (hostname: string, ctx: NetscriptContext): BaseServer {
|
||||
const server = GetServer(hostname);
|
||||
if (server == null) {
|
||||
throw ctx.makeRuntimeErrorMsg(`Invalid hostname: ${hostname}`);
|
||||
const str = hostname === "" ? "'' (empty string)" : "'" + hostname + "'";
|
||||
throw ctx.makeRuntimeErrorMsg(`Invalid hostname: ${str}`);
|
||||
}
|
||||
return server;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user