1
0
mirror of https://github.com/CyberL1/MyMcRealms.git synced 2024-11-21 13:38:21 -05:00

feat: better sounding error message

This commit is contained in:
CyberL1 2024-05-21 14:45:25 +02:00
parent 42397e6f93
commit f631b7519c

View File

@ -90,7 +90,8 @@ namespace MyMcRealms.Controllers
var api = new MyMcAPI.Wrapper(world.OwnersToken); var api = new MyMcAPI.Wrapper(world.OwnersToken);
var whitelist = await api.GetWhitelist(); var whitelist = await api.GetWhitelist();
if (whitelist == null) return BadRequest($"Cannot GET /whitelist for world {id}"); if (whitelist == null) return BadRequest($"Cannot get data for world {id}");
string worldOwnerName = world.Ops.ToArray().Length == 0 ? "Owner" : world.Ops[0].Name; string worldOwnerName = world.Ops.ToArray().Length == 0 ? "Owner" : world.Ops[0].Name;
string worldOwnerUuid = world.Ops.ToArray().Length == 0 ? "069a79f444e94726a5befca90e38aaf5" : world.Ops[0].Uuid; string worldOwnerUuid = world.Ops.ToArray().Length == 0 ? "069a79f444e94726a5befca90e38aaf5" : world.Ops[0].Uuid;
string worldName = world.Ops.ToArray().Length == 0 ? world.ServerName : $"{world.Ops[0].Name}'s server"; string worldName = world.Ops.ToArray().Length == 0 ? world.ServerName : $"{world.Ops[0].Name}'s server";