Skip to content

Conversation

@sgammon
Copy link
Member

@sgammon sgammon commented Jul 20, 2025

Ready for review Powered by Pull Request Badge

Summary

Restores pretty error handling. Given the script,

console.log("hi", missing)

And,

elide run ./err.js

Before this PR:

Uncaught fatal exception: org.graalvm.polyglot.PolyglotException: ReferenceError: missing is not defined
<js>.:program(err.js:1)
org.graalvm.polyglot/org.graalvm.polyglot.Value.execute(Value.java:1047)
elide.tool.cli.cmd.repl.ToolShellCommand.execWrapped(ToolShellCommand.kt:1656)
elide.tool.cli.cmd.repl.ToolShellCommand.executeSource(ToolShellCommand.kt:1870)
elide.tool.cli.cmd.repl.ToolShellCommand.invoke$lambda$191$lambda$174(ToolShellCommand.kt:2808)
elide.tool.cli.AbstractSubcommand.withDeferredContext(AbstractSubcommand.kt:686)
elide.tool.cli.AbstractSubcommand.withDeferredContext$default(AbstractSubcommand
...
elide.tool.cli.MainKt.main(main.kt:335)
java.base@24.0.2/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
ReferenceError: missing is not defined
        at <js> :program(tools/scripts/err.js:1:18-24)
        at org.graalvm.polyglot/org.graalvm.polyglot.Value.execute(Value.java:1047)
...

After this PR:

╔════════════════════════════════════════════════════════════════════════════════════╗
→  1┊ console.log("hi", missing)                                                     ║
╟────────────────────────────────────────────────────────────────────────────────────╢
║ ReferenceError: missing is not defined                                             ║
╟────────────────────────────────────────────────────────────────────────────────────╢
║ Stacktrace:                                                                        ║
║   ReferenceError: missing is not defined                                           ║
║       at err.js:1                                                                  ║
╚════════════════════════════════════════════════════════════════════════════════════╝

Changelog

fix: HostException visibility for error handling
chore: update `third_party/oracle/README.md`

@sgammon sgammon added this to the Release R18: Beta milestone Jul 20, 2025
@sgammon sgammon self-assigned this Jul 20, 2025
@sgammon sgammon added this to Elide Jul 20, 2025
@sgammon sgammon added bug Something isn't working module:cli CLI module issues and features lang:javascript Issues relating to JavaScript labels Jul 20, 2025
@codecov
Copy link

codecov bot commented Jul 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 85 lines in your changes missing coverage. Please review.

Project coverage is 39.80%. Comparing base (6bb5a29) to head (3796441).

Files with missing lines Patch % Lines
...kotlin/elide/tool/cli/cmd/repl/ToolShellCommand.kt 0.00% 59 Missing ⚠️
...main/kotlin/elide/tool/cli/cmd/repl/HandledExit.kt 0.00% 13 Missing ⚠️
...ackages/cli/src/main/kotlin/elide/tool/cli/main.kt 0.00% 8 Missing ⚠️
...cli/src/main/kotlin/elide/tool/err/ErrorHandler.kt 0.00% 3 Missing ⚠️
.../main/kotlin/elide/tool/cli/AbstractToolCommand.kt 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1564      +/-   ##
==========================================
- Coverage   39.87%   39.80%   -0.07%     
==========================================
  Files         768      769       +1     
  Lines       36940    37004      +64     
  Branches     5218     5235      +17     
==========================================
  Hits        14729    14729              
- Misses      20446    20510      +64     
  Partials     1765     1765              
Flag Coverage Δ
jvm 39.80% <0.00%> (-0.07%) ⬇️
lib 39.80% <0.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../main/kotlin/elide/tool/cli/AbstractToolCommand.kt 62.19% <0.00%> (-1.56%) ⬇️
...cli/src/main/kotlin/elide/tool/err/ErrorHandler.kt 0.00% <0.00%> (ø)
...ackages/cli/src/main/kotlin/elide/tool/cli/main.kt 0.00% <0.00%> (ø)
...main/kotlin/elide/tool/cli/cmd/repl/HandledExit.kt 0.00% <0.00%> (ø)
...kotlin/elide/tool/cli/cmd/repl/ToolShellCommand.kt 31.74% <0.00%> (-0.86%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6bb5a29...3796441. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Sam Gammon <sam@elide.dev>
@sgammon sgammon force-pushed the fix/guest-js-errors branch from 26a40d4 to 4e099fb Compare July 20, 2025 05:06
@sgammon sgammon moved this to Done in Elide Jul 20, 2025
@sgammon sgammon requested a review from a team July 20, 2025 05:06
@sgammon sgammon force-pushed the fix/guest-js-errors branch from 4e099fb to 1d893b2 Compare July 20, 2025 05:15
Fixes: #1557
Signed-off-by: Sam Gammon <sam@elide.dev>
@sgammon sgammon force-pushed the fix/guest-js-errors branch from 1d893b2 to 3796441 Compare July 20, 2025 06:09
@sgammon sgammon merged commit bf64335 into main Jul 20, 2025
18 checks passed
@sgammon sgammon mentioned this pull request Sep 21, 2025
31 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lang:javascript Issues relating to JavaScript module:cli CLI module issues and features

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants