Skip to content

Commit df442b4

Browse files
committed
Add unstable-net flags and log query errors
1 parent fe88ffe commit df442b4

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

deno.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
},
88
"tasks": {
99
"compile": "deno run --allow-env --allow-read --allow-run --allow-write scripts/build.ts",
10-
"start": "deno run --allow-env --allow-net --allow-read --allow-sys --allow-write main.ts",
11-
"dev": "deno run --allow-env --allow-net --allow-read --allow-sys --allow-write --watch main.ts"
10+
"start": "deno run --allow-env --allow-net --allow-read --allow-sys --allow-write --unstable-net main.ts",
11+
"dev": "deno run --allow-env --allow-net --allow-read --allow-sys --allow-write --unstable-net --watch main.ts"
1212
},
1313
"compilerOptions": {
1414
"jsx": "precompile",

lib/query/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export async function queryGameServer(
2828
};
2929
}
3030
}
31-
} catch {
31+
} catch (err) {
32+
const message = err instanceof Error ? err.message : String(err);
33+
console.error(`[query] ${protocol}://${host}:${port} failed: ${message}`);
3234
return { playerCount: null, maxPlayers: null, map: null };
3335
}
3436
}

scripts/build.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ async function build() {
5454
"--allow-read",
5555
"--allow-sys",
5656
"--allow-write",
57+
"--unstable-net",
5758
"-o",
5859
path.join(Deno.cwd(), "bin", "docker-control"),
5960
path.join(Deno.cwd(), "main.ts"),

0 commit comments

Comments
 (0)