From f49d139ee7622ecb16542c346c6c1341afb10bc7 Mon Sep 17 00:00:00 2001 From: Martin Bielik Date: Sat, 25 Mar 2023 18:50:47 +0100 Subject: handle connection timeout errors --- py/chat.py | 2 ++ py/complete.py | 2 ++ 2 files changed, 4 insertions(+) (limited to 'py') diff --git a/py/chat.py b/py/chat.py index 294ae63..8ef4e89 100644 --- a/py/chat.py +++ b/py/chat.py @@ -54,3 +54,5 @@ try: vim.command("redraw") except KeyboardInterrupt: vim.command("normal! a Ctrl-C...") +except openai.error.Timeout: + vim.command("normal! a Connection timeout...") diff --git a/py/complete.py b/py/complete.py index f82707a..1f32e3e 100644 --- a/py/complete.py +++ b/py/complete.py @@ -28,3 +28,5 @@ try: vim.command("redraw") except KeyboardInterrupt: vim.command("normal! a Ctrl-C...") +except openai.error.Timeout: + vim.command("normal! a Connection timeout...") -- cgit v1.2.3