diff --git a/ext/python-a2s-rcon-api/service.py b/ext/python-a2s-rcon-api/service.py index ba52efe..c41c136 100644 --- a/ext/python-a2s-rcon-api/service.py +++ b/ext/python-a2s-rcon-api/service.py @@ -94,12 +94,16 @@ class SourceBackend: if(request.password == None): return Response(status_code = 403) - status_lines:str = await VALVE_SERVER_RCON( - "status", - host = request.address, - port = request.port, - passwd = request.password - ) + try: + status_lines:str = await VALVE_SERVER_RCON( + "status", + host = request.address, + port = request.port, + passwd = request.password + ) + except UnicodeDecodeError as err: + print(f"Cannot execute 'status' on {request.address}:{request.port}, error: {err}") + return Response(status_code = 500) try: start_index = status_lines.index("# userid")