Spaces:
Running
Running
error console instead of crashing
Browse files
src/lib/server/generateFromDefaultEndpoint.ts
CHANGED
@@ -64,11 +64,13 @@ export async function generateFromDefaultEndpoint(
|
|
64 |
}
|
65 |
|
66 |
if (!resp.ok) {
|
67 |
-
|
|
|
68 |
}
|
69 |
|
70 |
if (!resp.body) {
|
71 |
-
|
|
|
72 |
}
|
73 |
|
74 |
const decoder = new TextDecoder();
|
|
|
64 |
}
|
65 |
|
66 |
if (!resp.ok) {
|
67 |
+
console.error(await resp.text());
|
68 |
+
return;
|
69 |
}
|
70 |
|
71 |
if (!resp.body) {
|
72 |
+
console.error("Body is empty");
|
73 |
+
return;
|
74 |
}
|
75 |
|
76 |
const decoder = new TextDecoder();
|