Hansimov commited on
Commit
3eecc54
1 Parent(s): 1f691c1

:zap: [Enhance] Log response content when failed to create

Browse files
conversations/conversation_creator.py CHANGED
@@ -32,7 +32,13 @@ class ConversationCreator:
32
  proxies=enver.envs.get("http_proxy") or None,
33
  cookies=self.httpx_cookies,
34
  )
35
- self.response_content = json.loads(self.response.content.decode("utf-8"))
 
 
 
 
 
 
36
  self.response_headers = dict(self.response.headers)
37
  pprint(self.response_content)
38
 
 
32
  proxies=enver.envs.get("http_proxy") or None,
33
  cookies=self.httpx_cookies,
34
  )
35
+ try:
36
+ self.response_content = json.loads(self.response.content.decode("utf-8"))
37
+ except:
38
+ print(self.response.content)
39
+ raise Exception(
40
+ f"x Failed to create conversation: {self.response.status_code}"
41
+ )
42
  self.response_headers = dict(self.response.headers)
43
  pprint(self.response_content)
44