website: Show playground errors

If there eval errors for playground examples, show the error.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
This commit is contained in:
Charlie Egan
2025-12-17 17:36:49 +00:00
committed by Stephan Renatus
parent 7e1c361478
commit d80ffc4ad2
+6 -2
View File
@@ -44,10 +44,14 @@ async function exec({ command, files }) {
stdout: JSON.stringify(body.result[0].expressions[0].value, undefined, 2),
};
}
const { message: stderr } = await resp.json();
const errorText = await resp.text();
return {
ok,
stderr,
stderr: errorText
.replace(/^"|"$/g, "")
.replace(/\\n/g, "\n")
.replace(/\\t/g, "\t"),
};
}