Form Error handling & small code cleanup

This commit is contained in:
ForestOfLight
2025-04-13 14:27:41 -07:00
Unverified
parent b74362166f
commit 1a56192682
7 changed files with 31 additions and 23 deletions
+7 -2
View File
@@ -110,8 +110,13 @@ export class InstanceEditForm {
this.player.sendMessage('§cInstance name cannot be empty.');
return;
}
structureCollection.rename(this.instanceName, newName);
this.instanceName = newName;
try {
structureCollection.rename(this.instanceName, newName);
this.instanceName = newName;
} catch (e) {
this.player.sendMessage(`§cError renaming instance: ${e.message}`);
return;
}
});
}