Fix process exit code and stderr printing 2 times #3098
Merged
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.
Proposed changes
If tedge-failed, process error code and stderr were printed 2 times like this:
Now it doesn't contain a duplicate:
This was due to unnoticed wrapping of the error types: all the functions returned
ConfigManagementError
, but we still wanted to attach context, so we had the following nesting, which screwed up anyhow's error causes formatting:ConfigManagementError::Other(anyhow::Error(source: ConfigManagementError::Other(anyhow::Error)))
Immediate function error type was changed to anyhow::Error, so now we only have a single conversion to ConfigManagementError on the outermost function.
Types of changes
Paste Link to the issue
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINESFurther comments
Question to @reubenmiller: how to tag these small PRs that are fixes, but minor ones, for which no issue was reported? I could tag this as an improvement, but it would probably be a bit misleading since the previous behaviour really was unintended, so for release notes perhaps it should categorised as a fix?