mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 23:33:12 +09:00
Show the instance ID when its details can't be fetched
InstanceDetailsGetRequest needs core.instance.get, which the player-sync list and show commands are not documented to require. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
004fb13f1c
commit
1d14148606
2 files changed
+17
-2
No files matched your search
@@ -13,8 +13,13 @@ async function instanceName(ctl: Ctl, instanceId: number | undefined) {
|
||||
if (instanceId === undefined) {
|
||||
return "-";
|
||||
}
|
||||
let instance = await ctl.send(new lib.InstanceDetailsGetRequest(instanceId));
|
||||
return `${instance.name} (${instanceId})`;
|
||||
try {
|
||||
let instance = await ctl.send(new lib.InstanceDetailsGetRequest(instanceId));
|
||||
return `${instance.name} (${instanceId})`;
|
||||
} catch (err) {
|
||||
// Viewing player data does not require core.instance.get
|
||||
return String(instanceId);
|
||||
}
|
||||
}
|
||||
|
||||
const playerSyncCommands = new lib.CommandTree({
|
||||
|
||||
Reference in new issue
Block a user