nsarrazin HF staff commited on
Commit
5b07906
1 Parent(s): 3acc11d

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
- throw new Error(await resp.text());
 
68
  }
69
 
70
  if (!resp.body) {
71
- throw new Error("Response body is empty");
 
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();