fix: api error

This commit is contained in:
0xMRTT 2023-05-21 23:23:47 +02:00
parent a92847a33a
commit 3ab6a403b9

View File

@ -55,6 +55,10 @@ class BaseOpenAIProvider(BavarderProvider):
self.win.banner.props.button_label = ""
self.win.banner.set_revealed(True)
return ""
except openai.error.APIError:
self.win.banner.props.title = "API Error"
self.win.banner.props.button_label = ""
self.win.banner.set_revealed(True)
except socket.gaierror:
self.no_connection()
return ""