Skip to content

Commit

Permalink
raise error when auth fails to get token. Reference: #81
Browse files Browse the repository at this point in the history
  • Loading branch information
gptlang committed Feb 26, 2024
1 parent 4248f51 commit 4741648
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rplugin/python3/CopilotChat/copilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def authenticate(self):
}

self.token = self.session.get(url, headers=headers).json()
if not self.token.get("token"):
raise Exception(f"Failed to authenticate: {self.token}")

def reset(self):
self.chat_history = []
Expand Down

0 comments on commit 4741648

Please sign in to comment.