Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: implicitly convert stderr to a String #4

Closed
n-eq opened this issue Feb 22, 2024 · 2 comments · Fixed by #5
Closed

Feature suggestion: implicitly convert stderr to a String #4

n-eq opened this issue Feb 22, 2024 · 2 comments · Fixed by #5

Comments

@n-eq
Copy link

n-eq commented Feb 22, 2024

Hello,

In MergeError::ExternalToolError, stderr contain the error logs of the external tool. However, currently it's a Vec<u8>. For cases when there is an error it would be much more helpful for debugging to directly return the error as a string, using String::from_utf8.

Does this sound interesting to you? I can create a PR unless you want to work on it.

Thanks!

@n-eq n-eq changed the title Feature suggestion: implicitely convert stderr to a String Feature suggestion: implicitly convert stderr to a String Feb 22, 2024
@tux3
Copy link
Owner

tux3 commented Feb 25, 2024

Hello, thanks for the suggestion, I think that's a good ergonomics improvement

I whipped up a branch quickly, let me know if that matches what you expected. I'm using from_utf8_lossy to avoid the failable case, but in practice this is for display, I don't think anyone will reasonably want to parse non-utf8 data from stdout/stderr

It's an API break, so requires a 2.0, but that's fine.

@n-eq
Copy link
Author

n-eq commented Feb 25, 2024

Thanks for the effort, I just reviewed your PR.

@tux3 tux3 closed this as completed in #5 Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants