improve error handling in minecraft monitor

This commit is contained in:
Daniel Lovbrotte Olsen 2022-08-03 03:39:41 +02:00
parent 6b79463322
commit 772a233815
2 changed files with 30 additions and 27 deletions

48
flake.lock generated
View File

@ -24,11 +24,11 @@
},
"locked": {
"host": "git.dodsorf.as",
"lastModified": 1654132489,
"narHash": "sha256-7L6gKN5Y2PbjK2aHX2jwOCZfe9R+7RusvuULy9EbKGs=",
"lastModified": 1656687988,
"narHash": "sha256-2ywoy3wUvFAyxDTw7VPlz5TGh9mk/um2AWOjhJqJxNQ=",
"owner": "Dandellion",
"repo": "NUR",
"rev": "9b6f60ce8a94d8269190dbe4ac9450f87910ac8b",
"rev": "7e85f62e40cd585ce81fa1f3debd5385bb0cad03",
"type": "gitlab"
},
"original": {
@ -41,11 +41,11 @@
"devshell": {
"flake": false,
"locked": {
"lastModified": 1654858401,
"narHash": "sha256-53bw34DtVJ2bnF6WEwy6Tym+qY0pNEiEwARUlvmTZjs=",
"lastModified": 1655976588,
"narHash": "sha256-VreHyH6ITkf/1EX/8h15UqhddJnUleb0HgbC3gMkAEQ=",
"owner": "numtide",
"repo": "devshell",
"rev": "f55e05c6d3bbe9acc7363bc8fc739518b2f02976",
"rev": "899ca4629020592a13a46783587f6e674179d1db",
"type": "github"
},
"original": {
@ -104,11 +104,11 @@
]
},
"locked": {
"lastModified": 1655826285,
"narHash": "sha256-dyrNTVBefSZWKdFNnAW+zUkO5bVo1colvLje4l1XXwA=",
"lastModified": 1655975833,
"narHash": "sha256-g8sdfuglIZ24oWVbntVzniNTJW+Z3n9DNL9w9Tt+UCE=",
"owner": "nix-community",
"repo": "dream2nix",
"rev": "f23add2b9c313c63dea5cff71523a850d29ffddb",
"rev": "4e75e665ec3a1cddae5266bed0dd72fce0b74a23",
"type": "github"
},
"original": {
@ -141,11 +141,11 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1656412598,
"narHash": "sha256-ooyXLsXj0xhlN4JTM2eXTGXZ0NnqGmL7EeU0z3HuK+o=",
"lastModified": 1659453202,
"narHash": "sha256-dCoACB8THPLgCZtbP4AzX+l/pzhUK078zo9mQGTvFUQ=",
"owner": "helix-editor",
"repo": "helix",
"rev": "ac1d8fa505e926d981682317e4e3d289bec4eb49",
"rev": "69f84e25165d62d0f38bcc80bf9108f9c0802cad",
"type": "github"
},
"original": {
@ -189,11 +189,11 @@
]
},
"locked": {
"lastModified": 1655826649,
"narHash": "sha256-C4/7CdB/mzuD9ayWvEA3Jcog6INCq+oUJZxUsIP/GvE=",
"lastModified": 1656453541,
"narHash": "sha256-ZCPVnS6zJOZJvIlwU3rKR8MBVm6A3F4/0mA7G1lQ3D0=",
"owner": "yusdacra",
"repo": "nix-cargo-integration",
"rev": "5cf1685c021c47631a2fb16533c00c8d68afd09e",
"rev": "9eb74345b30cd2e536d9dac9d4435d3c475605c7",
"type": "github"
},
"original": {
@ -204,11 +204,11 @@
},
"nixos-2205": {
"locked": {
"lastModified": 1656265786,
"narHash": "sha256-A9RkoGrxzsmMm0vily18p92Rasb+MbdDMaSnzmywXKw=",
"lastModified": 1659342832,
"narHash": "sha256-ePnxG4hacRd6oZMk+YeCSYMNUnHCe+qPLI0/+VaTu48=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "cd90e773eae83ba7733d2377b6cdf84d45558780",
"rev": "e43cf1748462c81202a32b26294e9f8eefcc3462",
"type": "github"
},
"original": {
@ -220,11 +220,11 @@
},
"nur": {
"locked": {
"lastModified": 1656395221,
"narHash": "sha256-jyt0FA2t4yBqDNX2fJJcGESL8qXrB8slOFnZmAg+5QY=",
"lastModified": 1659483824,
"narHash": "sha256-dJutEz8UQBi+g9GMBPJXnx54xn0Ow1a/JGV9Gxd9jpw=",
"owner": "nix-community",
"repo": "NUR",
"rev": "769f0930cec23b5fa803d2b580b14cf537f01f74",
"rev": "3902a6de021f928e2d0f4b71565853507a525bd1",
"type": "github"
},
"original": {
@ -267,11 +267,11 @@
},
"unstable": {
"locked": {
"lastModified": 1656338871,
"narHash": "sha256-+LOvZFt3MpWtrxXLH4igQtRVzyD43VnuTJjDVbt7phY=",
"lastModified": 1659464610,
"narHash": "sha256-X67Sbnn4lbo+RFWDjlG9oJsSWE6zg4S+LuQ5TLB2lCo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "819e4d63fc7f337a822a049fd055cd7615a5e0d6",
"rev": "f310f24f0d4cd5e8660ccde49e8cbd8dbf0295fa",
"type": "github"
},
"original": {

View File

@ -205,9 +205,12 @@ in
def getPlayers(server):
status = server.status()
players = getattr(getattr(status, "players"), "sample", [])
return players or []
try:
status = server.status()
except:
return []
else:
return status.players.sample or []
def build_players(list, server):