Skip to content

fix: show script exception text instead of empty message#222

Open
Jhoan0714 wants to merge 2 commits into
VibiumDev:mainfrom
Jhoan0714:fix/eval-empty-script-exception
Open

fix: show script exception text instead of empty message#222
Jhoan0714 wants to merge 2 commits into
VibiumDev:mainfrom
Jhoan0714:fix/eval-empty-script-exception

Conversation

@Jhoan0714

@Jhoan0714 Jhoan0714 commented Jul 9, 2026

Copy link
Copy Markdown

Summary

This PR fixes #221 — when vibium eval or MCP browser_evaluate runs JavaScript that throws, the CLI previously reported an empty error:

Error: failed to evaluate: script exception:

The browser did throw a real exception, but bidi.Client read the wrong field from the WebDriver BiDi response. This change parses exceptionDetails.text so users see the actual JavaScript error message.

Why this matters

  • Makes vibium eval debuggable when scripts fail (wrong variable, SecurityError on localStorage, etc.)
  • Same fix applies to MCP browser_evaluate and any path using CallFunction() through the BiDi client
  • Aligns with existing correct handling in parseScriptResult() (clicker/internal/api/helpers.go), which already reads exceptionDetails

Validation

Before fix:

vibium eval "localStorage.setItem('key', 'value')"
Error: failed to evaluate: script exception:

After fix:

Error: failed to evaluate: script exception: SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
image

Note: rebuild and restart the daemon (vibium daemon stop && vibium daemon start) to load the new binary.

@vincebln2 vincebln2 closed this Jul 9, 2026
@vincebln2 vincebln2 reopened this Jul 9, 2026
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.

vibium eval shows empty "script exception:" message instead of the real error

3 participants