From eaab1bfc8dda1150d63503d20dec6ad6d762bfa3 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Thu, 23 Nov 2023 12:54:36 +0100 Subject: [PATCH] feat: add some login --- src/lib/helpers/stability.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/helpers/stability.ts b/src/lib/helpers/stability.ts index 9f98f6f..94f2c52 100644 --- a/src/lib/helpers/stability.ts +++ b/src/lib/helpers/stability.ts @@ -38,11 +38,14 @@ export async function generateImage(prompt: string, negativePrompt: string) { } ); + if (!response.ok) { throw new Error(`Non-200 response: ${await response.text()}`) } const responseJSON = await response.json(); + console.log({ responseJSON }) + return responseJSON.artifacts[0]; }