mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-15 14:51:19 -08:00
Add error handling for 401 status in Copilot; refactor JsonRequest and response classes for improved structure and clarity
This commit is contained in:
parent
1fb8b7e4c9
commit
a55256a4c3
2 changed files with 7 additions and 6 deletions
|
|
@ -167,6 +167,8 @@ class Copilot(AsyncAuthedProvider, ProviderModelMixin):
|
|||
},
|
||||
json=data
|
||||
)
|
||||
if response.status_code == 401:
|
||||
raise MissingAuthError("Status 401: Invalid session")
|
||||
response.raise_for_status()
|
||||
conversation = Conversation(response.json().get("currentConversationId"))
|
||||
debug.log(f"Copilot: Created conversation: {conversation.conversation_id}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue