Files
root 6f59181f09 Rename dynamic dval to any and add port spawn options
Keep the compile-time generic marker as *. Update the compiler, stdlib,
fixtures, documentation and editor grammars without a dynamic type alias.
Preserve native identifiers and historical work and patch records.

Replace the port_spawn environment argument with cwd/env options. Report
failed directory changes through EXIT 127 with cwd_failed.

Compile every API example and add a complete Pi RPC service example.
Service examples compile without execution or output blocks. Update ABI
versions and audited golden artifacts.
2026-10-15 02:50:33 +00:00

43 lines
1.5 KiB
Plaintext

function RENDER(request : any)
{
var error := request.call.error
var signal_name := string(error.signal_name)
request.out.headers["Content-Type"] = "text/html; charset=utf-8"
print("<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"></meta><title>Something went wrong</title><style>body{font-family:system-ui,sans-serif;background:#1c1017;color:#fde8e8;margin:0;min-height:100vh}main{max-width:60rem;margin:0 auto;padding:3rem 2rem}h1{color:#f87171}code{color:#fca5a5}pre{background:#0f0a0d;color:#e2e8f0;padding:1rem;border-radius:.5rem;overflow-x:auto}.meta{color:#9f8a93;font-size:.9rem}</style></head><body><main><h1>Something went wrong</h1><p>",
html_escape(string(error.title)),
"</p><p class=\"meta\">Request: <code>",
html_escape(string(error.request_uri)),
"</code></p>"
)
var details := string(error.details)
if string(error.type) == "compile_error"
{
print("<p class=\"meta\">Unit: <code>",
html_escape(string(error.unit)),
"</code></p>"
)
var compiler_messages := string(error.compiler_messages)
if compiler_messages != ""
{
print("<pre>", html_escape(compiler_messages), "</pre>")
}
}
else
{
if details != ""
{
print("<p class=\"meta\">Details: ", html_escape(details), "</p>")
}
}
if signal_name != ""
{
print("<p class=\"meta\">Signal: ", html_escape(signal_name), "</p>")
}
var stack := string(error.trace)
if stack != ""
{
print("<pre>", html_escape(stack), "</pre>")
}
print("</main></body></html>")
}