sunfishcode opened PR #1274 from trap-exit
to master
:
Previously, the wasmtime CLI would return with a regular failure
error code, eg. 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.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
sunfishcode requested alexcrichton, and peterhuene for a review on PR #1274.
sunfishcode requested alexcrichton, and peterhuene for a review on PR #1274.
peterhuene submitted PR Review.
fitzgen submitted PR Review.
fitzgen created PR Review Comment:
Rather than hard-coding "check for a trap two error sources above this error in the chain" I think it would make sense to loop over the whole chain and check for if any of them is a trap. Does that make sense?
fitzgen submitted PR Review.
fitzgen created PR Review Comment:
let mut err = Some(&e); while let Some(source) = err { if source.is::<Trap>() { ... } err = source.source(); }
sunfishcode updated PR #1274 from trap-exit
to master
:
Previously, the wasmtime CLI would return with a regular failure
error code, eg. 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.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
sunfishcode submitted PR Review.
sunfishcode created PR Review Comment:
Makes sense to me! I've now added a patch to do that. I just had to make a slight tweek, since
e
here is ananyhow::Error
, so we have to start with the firstsource()
rather than starting withe
.
fitzgen submitted PR Review.
sunfishcode updated PR #1274 from trap-exit
to master
:
Previously, the wasmtime CLI would return with a regular failure
error code, eg. 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.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
alexcrichton created PR Review Comment:
FWIW when using anyhow I think we can just do
e.downcast_ref::<Trap>()
and it'll automatically check the entire chain forTrap
without having to usechain()
explicitly
alexcrichton submitted PR Review.
alexcrichton submitted PR Review.
sunfishcode updated PR #1274 from trap-exit
to master
:
Previously, the wasmtime CLI would return with a regular failure
error code, eg. 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.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
sunfishcode submitted PR Review.
sunfishcode created PR Review Comment:
Cool, and we can even simplify it to just
.is::<Trap>()
here.
sunfishcode updated PR #1274 from trap-exit
to master
:
Previously, the wasmtime CLI would return with a regular failure
error code, eg. 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.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
sunfishcode updated PR #1274 from trap-exit
to master
:
Previously, the wasmtime CLI would return with a regular failure
error code, eg. 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.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
sunfishcode updated PR #1274 from trap-exit
to master
:
Previously, the wasmtime CLI would return with a regular failure
error code, eg. 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.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
sunfishcode updated PR #1274 from trap-exit
to master
:
Previously, the wasmtime CLI would return with a regular failure
error code, eg. 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.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
sunfishcode updated PR #1274 from trap-exit
to master
:
Previously, the wasmtime CLI would return with a regular failure
error code, eg. 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.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
sunfishcode merged PR #1274.
Last updated: Dec 23 2024 at 12:05 UTC