-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exit with a more severe error code if the program traps. (#1274)
* Exit with a more severe error code if the program traps. Previously, the wasmtime CLI would return with a regular failure error code, such as 1 on Unix. However, a program trap indicates a bug in the program, which can be useful to distinguish from a simple error status. Check for the trap case, and return an appropriate OS-specific exit status. * Use a loop to iterate over the error causes to find Traps. * Use anyhow's `chain()` iterator. * For completeness, handle non-Unix and non-Windows platforms too. * Add a CLI test for a trapping program. * Replace a manual `.cause` loop with a `.is` call. * Correct the expected exit status on Windows. * Use assert_eq/assert_ne so that if these fail, it prints the output.
- Loading branch information
1 parent
81d9a5e
commit d44384d
Showing
3 changed files
with
66 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(module | ||
(func (export "_start") | ||
unreachable | ||
) | ||
) |