Skip to content

rune-luau: Script::try_render_fn returns a render's Result instead of the error card (#420) - #2168

Merged
opencodejr[bot] merged 1 commit into
devfrom
bot/issue-420
Nov 25, 2026
Merged

opencodejr[bot] merged 1 commit into
devfrom
bot/issue-420

Conversation

@opencodejr

@opencodejr opencodejr Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

This covers only the last point of #420: a host choosing what appears when a script fails, in place of the debug card. It doesn't touch history-dependent presentation, live rotation, the Luau wall clock or pipeline prewarming.

Change

  • New rune_luau::Script::try_render_fn(dark, f, args) -> Result<El, ScriptError>. It renders f(view, args...) once, outside any memo, and returns the error instead of drawing the error card, so a host can keep its last good tree on screen or draw its own fallback. A script that failed to start or stopped returns its stored error (Script::error), or ErrorKind::Missing if it has none.
  • The body of Inner::render_with moved into try_render_with, and render_with now only turns an Err into the error card. render_fn should behave the same: same render metrics, same error logging, same memo-salt bump on failure, same card messages.
  • Updated the rune-luau README table and added a changelog file.

Tests (crates/rune-luau/src/functions_tests.rs)

  • try_render_fn_returns_element_or_error: a working function returns Ok, and a throwing one returns Err with its message and logs it.
  • try_render_fn_returns_stored_failure: a script that fails at startup returns exactly its stored Script::error(), and no render runs.

Not run: the environment that wrote this change had no Rust toolchain, so nothing has been compiled. Please run cargo test -p rune-luau (needs a C++ compiler) and cargo check --workspace --all-targets before merging.

Closes #420

@opencodejr
opencodejr Bot merged commit 4080f2e into dev Nov 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Embedding: frames that depend only on the time they're drawn for

0 participants