An unhandled promise rejection is silently ignored and the run exits 0
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript
- Domain
- cli, compilers, documentation, testing
Research direction
Reproduce the shown Promise.reject script with GocciaRunner in both --mode=interpreted and --mode=bytecode, then read the GocciaRunner, GocciaTestRunner, and runScript entry points, including sandbox behavior. Done means unhandled rejections are reported with a failing result in the CLI and tests, later handlers avoid false reports, both modes are covered, and docs/errors.md describes the behavior.
Written by the indexing model from the issue text.
Description
Summary
A promise rejection that is never handled is silently ignored: GocciaRunner prints nothing and exits 0. Unhandled rejections should be reported, and should fail the run.
Why
Scripts and CI jobs rely on the exit status. A forgotten await or a missing .catch on a failing promise currently looks like success. ECMA-262 leaves rejection tracking to the host (HostPromiseRejectionTracker). Node.js and Deno both report an unhandled rejection with its error and exit non-zero by default. The docs don't describe GocciaScript's behavior either way.
Current behavior
On main (72cb2050), identical in --mode=interpreted and --mode=bytecode:
Promise.reject(new Error("unhandled"));
console.log("end of script");
This prints end of script and exits 0 with nothing on stderr. By contrast, an awaited rejection at top level (await Promise.reject(...)) is reported as an uncaught error.
Expected behavior
- When a rejected promise has no handler by the time the job queue drains (the usual HostPromiseRejectionTracker "reject" without a later "handle" rule), the CLI prints the rejection reason with the same formatting and code frame as an uncaught throw, and exits 1.
- A handler attached later, before the queue drains, cancels the report.
GocciaTestRunnerreports an unhandled rejection inside a test as a failure of that test or file.- Behavior is documented in
docs/errors.md.
Scope notes
- Decide whether embedders get a hook or setting rather than a hard-coded exit (the CLI default should fail).
- Check sandbox mode and
runScriptchildren; the child's result should expose the failure. This interacts with #1293, since jobs currently cross engine boundaries. - Add tests in both modes.
- Found while re-validating #1293.
- Dominant language
- Pascal
- Stars
- 20
- Forks
- 4
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 131
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from frostney/GocciaScript
-
performance runtime
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
frostney/GocciaScript#1567 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
frostney/GocciaScript#1510 ·
Maintainers usually reply within 1 day
-
documentation internal
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
frostney/GocciaScript#1271 ·
Maintainers usually reply within 1 day
-
internal
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
frostney/GocciaScript#1187 · 1 comment ·
Maintainers usually reply within 1 day
-
bug internal
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
frostney/GocciaScript#1129 ·
Maintainers usually reply within 1 day
All issues in frostney/GocciaScript
Similar issues
-
[Bug]: [MCP/CLI] Bare loopback IP addresses (127.0.0.1:port) and hosts with ports fail to navigate due to erroneous scheme inferencePossibly taken @alok-108 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/playwright#43263 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mishraprafful/multihull#150 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
paperclipai/paperclip#15751 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
mvanhorn/cli-printing-press#4980 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day