mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
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:
committed by
Stephan Renatus
parent
7e1c361478
commit
d80ffc4ad2
@@ -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"),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user