Skip to content

Commit

Permalink
Merge pull request SawyerHood#7 from shtepcell/feature/error-message
Browse files Browse the repository at this point in the history
fix: add error message
  • Loading branch information
SawyerHood committed Nov 9, 2023
2 parents 9a5f61f + 1f0d75a commit 946c32a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ function ExportButton({ setHtml }: { setHtml: (html: string) => void }) {
});

const json = await resp.json();

if (json.error) {
alert(json.error.message);
return;
}

const message = json.choices[0].message.content;
const start = message.indexOf("<!DOCTYPE html>");
const end = message.indexOf("</html>");
Expand Down

0 comments on commit 946c32a

Please sign in to comment.