Spaces:
Sleeping
Sleeping
Update application/static/js/components/initialize.js
Browse files
application/static/js/components/initialize.js
CHANGED
|
@@ -136,8 +136,9 @@ class Initialize {
|
|
| 136 |
try {
|
| 137 |
const response = await requests.request('POST', '/create', { "Content-Type": "application/json" }, JSON.stringify({ "system_prompt": this.systemPrompt }), false);
|
| 138 |
if (!response.ok) {
|
| 139 |
-
|
| 140 |
-
|
|
|
|
| 141 |
}
|
| 142 |
const data = await response.json();
|
| 143 |
this.convId = data['convId']; // Set the convId
|
|
|
|
| 136 |
try {
|
| 137 |
const response = await requests.request('POST', '/create', { "Content-Type": "application/json" }, JSON.stringify({ "system_prompt": this.systemPrompt }), false);
|
| 138 |
if (!response.ok) {
|
| 139 |
+
// No need to call response.text() here. The error is already being thrown by request.js
|
| 140 |
+
// const errorText = await response.text(); // THIS LINE IS REMOVED
|
| 141 |
+
throw new Error(`Error creating conversation: ${response.status}`); // Simplified error
|
| 142 |
}
|
| 143 |
const data = await response.json();
|
| 144 |
this.convId = data['convId']; // Set the convId
|