Spaces:
Sleeping
Sleeping
Update src/App.jsx
Browse files- src/App.jsx +6 -6
src/App.jsx
CHANGED
|
@@ -60,13 +60,13 @@ function App() {
|
|
| 60 |
//console.log("response",response);
|
| 61 |
//console.log("response.json()",response.json())
|
| 62 |
|
| 63 |
-
if (!response.ok) {
|
| 64 |
// Read raw text so HTML errors don’t crash JSON parsing
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
} else {
|
| 68 |
-
|
| 69 |
-
}
|
| 70 |
|
| 71 |
if (!response.ok) {
|
| 72 |
throw new Error(`HTTP error! status: ${response.status}`);
|
|
|
|
| 60 |
//console.log("response",response);
|
| 61 |
//console.log("response.json()",response.json())
|
| 62 |
|
| 63 |
+
//if (!response.ok) {
|
| 64 |
// Read raw text so HTML errors don’t crash JSON parsing
|
| 65 |
+
// const text = await response.text();
|
| 66 |
+
// throw new Error(`Backend ${response.status}: ${text}`);
|
| 67 |
+
//} else {
|
| 68 |
+
// data = await response.json(); // safe now
|
| 69 |
+
//}
|
| 70 |
|
| 71 |
if (!response.ok) {
|
| 72 |
throw new Error(`HTTP error! status: ${response.status}`);
|