Skip to content

Headless appleEvent () raises an empty error that escapes UserTalk try blocks #900

Open

Description

@jsavin

Problem

In the headless build, calling appleEvent () (e.g. against a stored code resource, as the legacy system.extensions.latinToMac scripts did) fails by raising an error with an EMPTY message that ESCAPES UserTalk try blocks entirely. Two independent symptoms:

  1. try {appleEvent-calling-script()} else {err = tryError} does not catch: the whole protocol script/eval fails with script_error and no [lang-ERROR] line is logged.
  2. When the escape happens inside a webserver responder, kernel webserver.dispatch renders its 500 page with the langevaluate.c:1214 fallback text "Unknown error." -- because tryError is empty. This also defeats mainResponder.respond's own error-page path (respond.ut:902's outer try/else never fires), so the operator sees a bare 500 instead of the diagnostic error page.

Bisection evidence (from Unit B / #870 root-causing)

  • GET /setupFrontier on the http2 port returned HTTP/1.1 500 Server Error / "Unknown error." (webserver's generic page, empty tryError).
  • Direct mainResponder.respond() with the same param table: the error escaped an enclosing try {} else {} -- the protocol eval itself failed, no message logged anywhere.
  • Bisected stepwise to latinToMac.macToLatin -> system.extensions.latinToMac scripts -> the appleEvent (@latintomac.code68K, 'cvtx', ...) call (isCarbon is false headless, so the scripts fell through to the appleEvent path). Kernel string.latinToMac/string.macToLatin on the same inputs work fine.
  • The latinToMac scripts have since been routed to the kernel verbs headless (Unit B), but the underlying appleEvent failure mode remains for any other legacy content that calls it.

Expected behavior

Headless appleEvent () should fail with a normal catchable scriptError carrying a message (e.g. "Apple events are not supported in the headless build"), like other unsupported-surface verbs (compare "op.attributes verbs are not supported in headless mode"). An error that bypasses try and carries no text breaks both script-level recovery and every error-reporting layer above it.

Where to look

  • frontier-cli/stubs/headless_mac_compat.c (AE stubs around appleevent_clear_desc, AEProcessAppleEvent, AECoerceDesc)
  • Common/source/langverbs.c appleevent dispatch ("remaining very basic verbs, implemented in lang.c")
  • Common/source/langevaluate.c:1214 ("Unknown error in try block." fallback) -- the empty-message path

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions