fix(cli): return non-zero exit code on uncaught runtime exceptions - #5465
Open
mmustafasenoglu wants to merge 3 commits into
Open
fix(cli): return non-zero exit code on uncaught runtime exceptions#5465mmustafasenoglu wants to merge 3 commits into
mmustafasenoglu wants to merge 3 commits into
Conversation
Previously, uncaught runtime exceptions (e.g. ReferenceError, throw statements) were printed to stderr but the process still exited with code 0. Syntax errors already returned non-zero. Add error propagation via eyre::Result in evaluate_expr and evaluate_file so that any uncaught error causes the CLI to exit with a non-zero status code. Also adds integration tests verifying non-zero exit codes for stdin, -e expression, and file execution uncaught errors. Fixes boa-dev#4962 Signed-off-by: Mustafa Senoglu <mmustafasenoglu0@gmail.com>
Test262 conformance changes
Tested main commit: |
…rop lint The MSRV and Lint CI jobs fail because `let _ = fs::remove_file(...)` triggers the `let-underscore-drop` lint (implied by `-D warnings`). Replace with an explicit `drop()` call which is the idiomatic way to signal intentional discard of a Drop type. Fixes CI for boa-dev#5465 Signed-off-by: Mustafa Senoglu <mmustafasenoglu0@gmail.com>
The test binary only uses std but Cargo.toml exposes all cli dependencies, causing unused_extern_crates warnings under -D warnings. Signed-off-by: Mustafa Senoglu <mmustafasenoglu0@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5465 +/- ##
===========================================
+ Coverage 47.24% 62.87% +15.63%
===========================================
Files 476 530 +54
Lines 46892 59109 +12217
===========================================
+ Hits 22154 37165 +15011
+ Misses 24738 21944 -2794 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the CLI exiting with code 0 when an uncaught runtime exception occurs. Syntax errors already returned non-zero; this extends the same behavior to runtime errors.
Changes
-eexpression, and file execution uncaught errors.Before/After
127
127
Fixes #4962
Closes #4964 (supersedes stalled PR)