feat: handle template build error

This commit is contained in:
2024-12-02 13:45:49 +00:00
parent 8a8582e06e
commit dc97c2c498
9 changed files with 123 additions and 11 deletions

View File

@@ -144,6 +144,10 @@ async function buildTemplate({
Accept: "text/event-stream",
},
});
if (res.status !== 200) {
const errBody = await res.json();
throw errBody;
}
const stream = res.body?.pipeThrough(new TextDecoderStream()).getReader();
if (stream) {
while (true) {