From eb33b9bb4428c02a2a6d77a0cedb9520843d27cf Mon Sep 17 00:00:00 2001 From: okada Date: Mon, 4 Dec 2023 23:30:07 +0900 Subject: [PATCH] fix error handling --- flatline_lsp.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/flatline_lsp.py b/flatline_lsp.py index 457a01d..b517fe0 100644 --- a/flatline_lsp.py +++ b/flatline_lsp.py @@ -59,11 +59,14 @@ def __init__( stderr=subprocess.DEVNULL, ) while True: - res = requests.get( - f"http://{self.backend_server_host}:{self.backend_server_port}" - ) - if res.status_code == 200: - break + try: + res = requests.get( + f"http://{self.backend_server_host}:{self.backend_server_port}" + ) + if res.status_code == 200: + break + except Exception: + pass time.sleep(1) @property