mirror of
https://github.com/SantaSpeen/Rcon-VK-Bot.git
synced 2026-10-27 22:39:57 +00:00
Rcon Exception handler
This commit is contained in:
1 parent
edf6fe6f92
commit
26a5aedd18
1 file changed
+6
-2
@@ -33,8 +33,11 @@ def fix_rcon_text(_srt):
|
|||||||
|
|
||||||
|
|
||||||
def rcon(cmd):
|
def rcon(cmd):
|
||||||
with MCRcon(host, password, port) as mcr:
|
try:
|
||||||
return fix_rcon_text(mcr.command(cmd))
|
with MCRcon(host, password, port) as mcr:
|
||||||
|
return fix_rcon_text(mcr.command(cmd))
|
||||||
|
except Exception as e:
|
||||||
|
return f"Rcon error"
|
||||||
|
|
||||||
|
|
||||||
def get_lp_server():
|
def get_lp_server():
|
||||||
@@ -74,6 +77,7 @@ def main():
|
|||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
ts = lp.get('ts')
|
||||||
print(f"Found exception: {e}")
|
print(f"Found exception: {e}")
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user