Update app.py
Browse files
app.py
CHANGED
@@ -113,6 +113,11 @@ def request_to_v2(message, cookie, user_id,context=[]):
|
|
113 |
post_msg_data = json.dumps(post_msg_data)
|
114 |
# print(post_msg_data)
|
115 |
|
|
|
|
|
|
|
|
|
|
|
116 |
try:
|
117 |
response = requests.post(post_msg_url, headers=headers, data=post_msg_data, verify=False, stream=False,timeout = timeout)
|
118 |
bots = ""
|
@@ -134,8 +139,9 @@ def request_to_v2(message, cookie, user_id,context=[]):
|
|
134 |
except Exception as e:
|
135 |
print(">>>>>> 查询失败")
|
136 |
print(e)
|
137 |
-
print(response.
|
138 |
-
|
|
|
139 |
context += [response]
|
140 |
responses = [(u, b) for u, b in zip(context[::2], context[1::2])]
|
141 |
|
|
|
113 |
post_msg_data = json.dumps(post_msg_data)
|
114 |
# print(post_msg_data)
|
115 |
|
116 |
+
response = {
|
117 |
+
"status_code":-1,
|
118 |
+
"text":"报错啦"
|
119 |
+
}
|
120 |
+
|
121 |
try:
|
122 |
response = requests.post(post_msg_url, headers=headers, data=post_msg_data, verify=False, stream=False,timeout = timeout)
|
123 |
bots = ""
|
|
|
139 |
except Exception as e:
|
140 |
print(">>>>>> 查询失败")
|
141 |
print(e)
|
142 |
+
print(response.text)
|
143 |
+
|
144 |
+
response =">>>>>> 查询失败\n报错信息为:"+ str(e) + f"\n response信息:\n错误代码:{response.status_code}\n错误信息{response.text}"
|
145 |
context += [response]
|
146 |
responses = [(u, b) for u, b in zip(context[::2], context[1::2])]
|
147 |
|