Skip to content

Uncaught error text in Slice.evalSandbox repeats the source location #45

Closed

Description

@siktec-lab

The error text for an uncaught exception in Slice.evalSandbox repeats the source location on the stack frame line.

Repro (throw.js)

const r = Slice.evalSandbox('throw new Error("boom")');
console.log(r.error);
slice run throw.js

Expected

Uncaught Error: boom (unknown at :2:7)
    at <main> (unknown at :2:7)

Actual

Uncaught Error: boom (unknown at :2:7)
    at <main> (unknown at :2:7) (unknown at :2:7)

The same text is returned in the error field of slice mcp slice_eval_ts.

Minor, but this text is shown directly to users and agents, and the line number :2 for a one-line snippet suggests the reported position includes an internal wrapper line, which may also be worth correcting.

Environment

  • Version: v0.10.6, commit c6b3e77
  • OS: Windows 11 x64, release build (cargo build --release)

Activity

  1. siktec-lab commented on Nov 10, 2026

    @siktec-lab
    CollaboratorAuthor

    Fixed in #46 (2c3e16a):

    1. Deduplicated location parentheticals in finish_boa_compartment_execution when raw_err or stack frames already include (unknown at ...).
    2. Removed the extra leading newline in standalone SLICEBOA{ wrappers so single-line Slice.evalSandbox snippets report line :1: instead of :2:.
    3. Updated Tier-0 JSON.parse to return Uncaught SyntaxError on malformed JSON.
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions